Created
May 30, 2019 08:57
-
-
Save pando85/a16219a4c8ab0451048804c8fbacd5a4 to your computer and use it in GitHub Desktop.
User Data for jenkins slave in Openstack
This file contains hidden or 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
#!/bin/bash | |
curl ${SLAVE_JAR_URL} -o /var/lib/jenkins/agent.jar | |
#/etc/systemd/system/sebasshtian.service | |
cat << EOF > /etc/systemd/system/jenkins-slave.service | |
[Unit] | |
Description=Jenkins-slave | |
After=network.target | |
[Service] | |
Type=simple | |
User=jenkins | |
Restart=always | |
RestartSec=5 | |
ExecStart=/bin/java -jar /var/lib/jenkins/agent.jar -jnlpUrl ${SLAVE_JNLP_URL} -secret ${SLAVE_JNLP_SECRET} -workDir "/var/lib/jenkins" | |
KillMode=process | |
[Install] | |
WantedBy=multi-user.target | |
EOF | |
systemctl daemon-reload | |
systemctl enable jenkins-slave | |
systemctl start jenkins-slave |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment