devops:ci:jenkins
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
devops:ci:jenkins [2023/11/01 07:15] – removed - external edit (Unknown date) 127.0.0.1 | devops:ci:jenkins [2024/02/09 07:10] (current) – skipidar | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== Jenkins ====== | ||
+ | {{https:// | ||
+ | |||
+ | == Pipeline == | ||
+ | {{https:// | ||
+ | |||
+ | == Install build slaves as a service == | ||
+ | |||
+ | - download the slave-agent.jnlp from the jenkins node | ||
+ | - 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 | ||
+ | - then type javaws <FQDN of the slave-agent.jnlp> | ||
+ | - once the slave connects, click on file and the n install as service | ||
+ | |||
+ | |||
+ | ==== Using nodes as GUI test nodes in cloud ===== | ||
+ | |||
+ | * To be able to run GUI tests on a test-slave - jenkins-slave process must be executed in Interactive Mode, in a user session. | ||
+ | (services, usual tasks are NOT executed in interactive mode) | ||
+ | * The Windows session should be started automatically directly after the server startup. | ||
+ | * Slave-Machine should register itself automatically as a test-slave at Jenkins, right after the startup. | ||
+ | * The slave must be capable to execute everything, what the tests require. | ||
+ | |||
+ | == 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. | ||
+ | < | ||
+ | " | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==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 " | ||
+ | Name this script addSwarmSlaveToJenkins.bat and use it in the next chapter. | ||
+ | < | ||
+ | java -jar C: | ||
+ | </ | ||
+ | |||
+ | |||
+ | == 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 " | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== Plugins ===== | ||
+ | |||
+ | Here you can download the plugins manually in HPI form, | ||
+ | to install them manually | ||
+ | https:// | ||
+ | |||
+ | |||
+ | == Swarm Plugin == | ||
+ | |||
+ | Useful to make nodes add themselves to the Jenkins: | ||
+ | * choosing labels | ||
+ | * choosing environment variables | ||
+ | * ... | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | === 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:// | ||
+ | |||
+ | But indeed no wraper would work reliably, because its a feature of jenkins named " | ||
+ | This feature can be disabled: | ||
+ | |||
+ | https:// | ||
+ | |||
+ | < | ||
+ | @echo off | ||
+ | |||
+ | |||
+ | ::start server via a wrapper script, so that Jenkins does not complain about leaking handler https:// | ||
+ | set ANTRUN_OUTPUT=" | ||
+ | C: | ||
+ | |||
+ | |||
+ | :: wait until it is up and running | ||
+ | set serverisRunning="" | ||
+ | : | ||
+ | if %serverisRunning% == "" | ||
+ | echo Waiting for server to start | ||
+ | sleep 10 | ||
+ | for /f %%i in (' | ||
+ | goto : | ||
+ | ) | ||
+ | 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 " | ||
+ | Or maintaining groups under Oraganisational Group " | ||
+ | Or using Posix Groups for organising people. <br> | ||
+ | |||
+ | {{https:// | ||
+ | |||
+ | {{https:// | ||
+ | |||
+ | |||
+ | |||