Created
February 24, 2021 15:29
-
-
Save kyxap1/6219b4d668cf7f9e9854a3c392d16d8c to your computer and use it in GitHub Desktop.
Jenkins agent as windows service with Non-Sucking Service Manager (NSSM)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nssm install Jenkins "%COMMONPROGRAMFILES(x86)%\Oracle\Java\javapath\java.exe" | |
nssm set Jenkins AppParameters -jar agent.jar -jnlpUrl https://<jenksins-server-url>/computer/<jenkins-worker-node>/slave-agent.jnlp -secret <worker-secret> -workDir "C:\jenkins\" | |
nssm set Jenkins AppDirectory C:\Jenkins | |
nssm set Jenkins AppStdout C:\Jenkins\jenkins.log | |
nssm set Jenkins AppStderr C:\Jenkins\jenkins.log | |
nssm set Jenkins AppStopMethodSkip 6 | |
nssm set Jenkins AppStopMethodConsole 1000 | |
nssm set Jenkins AppThrottle 5000 | |
nssm start Jenkins |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment