Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Systemd service file for Jenkins agent on Ubuntu 20.04 Focal Fossa
# Steps to install Jenkins Agent using JNLP connection on Ubuntu 20.04 Focal Fossa
# * create an Agent node on the web GUI:
# * $ sudo apt-get install -y openjdk-14-jre-headless
# * $ sudo adduser jenkins
# * $ curl http://jenkins-master.internal/jnlpJars/agent.jar -o /home/jenkins/agent.jar
# * create systemd service: place this file in /lib/systemd/system/jenkins-agent.service
# * $ sudo systemctl enable myservice
# * $ sudo systemctl start jenkins-agent
Description=Jenkins Agent
# optional file to provide environment variables (e.g. http_proxy, https_proxy):
# TODO: adapt -jnlpUrl und -secret, as found on the web GUI: Jenkins > Nodes > ...
ExecStart=/usr/bin/java -jar /home/jenkins/agent.jar -jnlpUrl http://jenkins-master.internal:8080/computer/Linux/slave-agent.jnlp -secret 6bd5082ce1531212341234123412341234123412341234123412341234764898 -workDir "/home/jenkins"

This comment has been minimized.

Copy link

@HEXtoDEC HEXtoDEC commented Jul 14, 2021

nice man!

but how to use user jenkins without passwd?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment