|
|
|
@ -27,11 +27,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
## Steps
|
|
|
|
## Steps
|
|
|
|
- Create a jenkins slave node setup on jenkins server
|
|
|
|
- Create a jenkins slave node setup on jenkins server
|
|
|
|
- Install JDK 11 (Preferable the same version as Jenkins Master Version)
|
|
|
|
### Slave Machine
|
|
|
|
|
|
|
|
- Install [Git](https://git-scm.com)
|
|
|
|
|
|
|
|
- Install [AdoptOpenJDK](https://adoptopenjdk.net) 11 (Preferable the same version as Jenkins Master Version)
|
|
|
|
- Create a folder `C:\jenkins`
|
|
|
|
- Create a folder `C:\jenkins`
|
|
|
|
- Download `agent.jar` from jenkins server
|
|
|
|
- Download `agent.jar` from jenkins server
|
|
|
|
- Run the agent using the `Windows Service Wrapper` as a Windows Service and log on as `jenkins` user profile
|
|
|
|
- Run as Administrator a command prompt
|
|
|
|
- Create a ssh key and update `rsa_id.pub` to git server to allow agent to clone from git repo
|
|
|
|
- Install the agent service using the `Windows Service Wrapper` as a Windows Service and log on as `jenkins` user profile
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
|
|
|
$ jenkins-agent.exe install
|
|
|
|
|
|
|
|
$ jenkins-agent.exe start
|
|
|
|
|
|
|
|
$ jenkins-agent.exe stop
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
- Create a ssh key `ssh-keygen` and update `rsa_id.pub` to git server (eg: under jenkins user) to allow agent to clone from git repo
|
|
|
|
|
|
|
|
|
|
|
|
```xml
|
|
|
|
```xml
|
|
|
|
<service>
|
|
|
|
<service>
|
|
|
|
@ -40,7 +48,7 @@
|
|
|
|
<description>This service runs agent process connected to jenkins:8080</description>
|
|
|
|
<description>This service runs agent process connected to jenkins:8080</description>
|
|
|
|
<env name="JENKINS_HOME" value="%BASE%" />
|
|
|
|
<env name="JENKINS_HOME" value="%BASE%" />
|
|
|
|
<executable>C:\tools\jdk-11\bin\java.exe</executable>
|
|
|
|
<executable>C:\tools\jdk-11\bin\java.exe</executable>
|
|
|
|
<arguments>-jar c:\jenins\agent.jar -jnlpurl http://jenkins:8080/jenkins-agent.jnlp -secret abcd -wordDir "c:\jenkins"</arguments>
|
|
|
|
<arguments>-jar c:\jenkins\agent.jar -jnlpUrl http://jenkins:8080/jenkins-agent.jnlp -secret abcd -wordDir "c:\jenkins"</arguments>
|
|
|
|
<log mode="roll" />
|
|
|
|
<log mode="roll" />
|
|
|
|
<onfailure action="restart" />
|
|
|
|
<onfailure action="restart" />
|
|
|
|
<serviceaccount>
|
|
|
|
<serviceaccount>
|
|
|
|
|