Skip to content

Instantly share code, notes, and snippets.

@kyxap1
Created February 24, 2021 15:29
Show Gist options
  • Save kyxap1/6219b4d668cf7f9e9854a3c392d16d8c to your computer and use it in GitHub Desktop.
Save kyxap1/6219b4d668cf7f9e9854a3c392d16d8c to your computer and use it in GitHub Desktop.
Jenkins agent as windows service with Non-Sucking Service Manager (NSSM)
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