Skip to content

Tools for installing Jenkins Agent as a windows service

Notifications You must be signed in to change notification settings

KayOtiq/JenkinsAgentInstaller

Repository files navigation

How to Manually Install a Jenkins Slave

Intro

Tools for installing Jenkins Agent as a windows service

Steps

  1. Log into the Jenkins controller and create the new node

  2. Log onto the agent. Create a new working directory for the Jenkins . Example: C:\Apps\Jenkins-Home

  3. Copy the following files to the new folder

    • jenkins-agent.exe
    • jenkins-agent.xml
    • jenkins-agent.exe.config
  4. Open a Windows command line as Administrator.

  5. Navigate to the directory where the jenkins-slave.exe is installed. Example:

    cd C:\Apps\Jenkins-Home

  6. Install the service

    jenkins-agent.exe install

  7. After the service has been succesfully installed, a message similar to the following should appear

    2021-08-22 10:17:30,486 INFO - Installing the service with id 'jenkins-agent'

  8. Right click Windows start button, select Run, then enter "services.msc" to open Windows Service management console. Scroll down until you find the 'jenkins-agent' Windows service.

  9. Update the service to run as a service account. Right click the 'jenkins-agent' service, select properties.

  10. Right click the service and select 'Start' to start the service

Managing the services

  1. To change the service name:

    $ sc config <service-name> displayname="jenkins-agent-1"

  2. To delete a service:

    sc delete <service-name>

References

https://www.jenkins.io/doc/book/using/using-agents/ https://support.cloudbees.com/hc/en-us/articles/217423827-How-to-Install-Several-Windows-Agents-as-a-Service-?page=76 https://github.com/winsw/winsw/blob/master/doc/installation.md https://github.com/winsw/winsw/blob/master/doc/xmlConfigFile.md

https://stackoverflow.com/questions/44751960/install-jenkins-slave-as-a-windows-service-in-command-line https://stackoverflow.com/questions/24255439/how-to-setup-jenkins-slave-to-run-as-a-windows-service-using-command-line/45153740

In case of PKIX error: https://support.cloudbees.com/hc/en-us/articles/217078498-PKIX-path-building-failed-error-message?page=76

Original WinSW https://repo.jenkins-ci.org/ui/native/releases/com/sun/winsw/winsw/2.9.0

WinSW .xml examples https://github.com/winsw/winsw/tree/v3/samples

About

Tools for installing Jenkins Agent as a windows service

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published