Table of Contents

Jenkins

Pipeline

Install build slaves as a service
  1. download the slave-agent.jnlp from the jenkins node
  2. open cmd and check the java version. if version is 1.6 get the jdk 7 folder from any RDP and do a cd to the jre\bin path of jdk7
  3. then type javaws <FQDN of the slave-agent.jnlp>
  4. once the slave connects, click on file and the n install as service

Using nodes as GUI test nodes in cloud

(services, usual tasks are NOT executed in interactive mode)

Start a Windows Session (Interactive mode) at startup

Use the Sysinternals tool Autologon for that.

Execute the following script once for the session to be started automatically.

"C:\Program Files (x86)\Sysinternals\Autologon.exe" YOURUSER . YOURPASS
Tool to connect a machine to the Jenkins as build slave

Use Jenkins-Swarm-Plugin for that,

Execute the following script to connect a machine to a Jenkins as a Slave. The slave will have label “sikuli” . Name this script addSwarmSlaveToJenkins.bat and use it in the next chapter.

java -jar C:\temp\EXP_swarm\swarm-client-2.2-jar-with-dependencies.jar -executors 2 -fsroot c:\Jenkins -labels "sikuli %ComputerName%" -master http://10.0.0.198:5555 -name farm-%ComputerName% -username YOURUSER -password YOURPASS
Start Jenkins - slave within the Interactive-mode-session

Use the Windows Task Scheduler for that.

Execute the following script once to create a task, which will be executed, when the user logs in. Explicitely at Autologon too.

schtasks /Create /RU YOURUSER /RP YOURPASS /SC ONLOGON /TN "Connect to Jenkins as swarm slave" /TR c:\temp\EXP_swarm\addSwarmSlaveToJenkins.bat /IT

Plugins

Here you can download the plugins manually in HPI form, to install them manually https://updates.jenkins-ci.org/download/plugins/

Swarm Plugin

Useful to make nodes add themselves to the Jenkins:

SCRIPT to spawn a process in Jenkins and monitor log files for text

THe problem is - Jenkins kills spawned processes together with the job. Solution: use a wrapper script. https://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build

But indeed no wraper would work reliably, because its a feature of jenkins named “ProcessTreeKiller” which is reponsible for killing the preocesses. This feature can be disabled:

https://wiki.jenkins.io/display/JENKINS/ProcessTreeKiller

@echo off


::start server via a wrapper script, so that Jenkins does not complain about leaking handler https://wiki.jenkins-ci.org/display/JENKINS/Spawning+processes+from+build
set ANTRUN_OUTPUT="C:\tmp\StartWeblogicTOI.html"
C:\tmp\wrapperScript.js "C:\tmp\startTOICmd.bat"


:: wait until it is up and running
set serverisRunning=""
:whileWaiting
if %serverisRunning% == "" (
	echo Waiting for server to start
	sleep 10
	for /f %%i in ('Findstr /I /M /C:"state changed to running" C:\tmp\StartWeblogicTOI.html') do set "serverisRunning='%%i'"
	goto :whileWaiting
)
time /T
echo Server is running now

LDAP

Configuring the Jenkins using LDAP requires a predefined LDAP structure. <br> E.g. putting users to Oraganisational Group “people” <br> Or maintaining groups under Oraganisational Group “groups”. <br> Or using Posix Groups for organising people. <br>