Last active
May 18, 2023 14:43
-
-
Save reinaldons/8526831 to your computer and use it in GitHub Desktop.
Arch Linux service for Jenkins Slave via JNLP agent.
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
JENKINS_HOME="/usr/share/java/jenkins" | |
LOG="/var/log/slave-jenkins.log" | |
JENKINS_URL="http://jenkins.url:8080" | |
SLAVE_COMPUTER="slave_computer_name" | |
REMOTE_JAR="$JENKINS_URL/jnlpJars/slave.jar" | |
JNLP_URL="$JENKINS_URL/computer/$SLAVE_COMPUTER/slave-agent.jnlp" | |
SECRET="YOUR SECRET ON JENKINS" |
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
[Unit] | |
Description=Jenkins Slave | |
After=network.target | |
[Service] | |
Type=simple | |
User=jenkins | |
EnvironmentFile=/etc/conf.d/jenkins-slave | |
ExecStartPre=/usr/bin/wget $REMOTE_JAR -O $LOCAL_JAR && chown jenkins $LOCAL_JAR | |
ExecStart=/opt/java/bin/java -DJENKINS_HOME=$JENKINS_HOME -jar $LOCAL_JAR -jnlpUrl $JNLP_URL -secret $SECRET -slaveLog $LOG | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment