Last active
June 5, 2019 20:46
-
-
Save claydanford/4bc4cc7cea86d8a57102b725a3eb1498 to your computer and use it in GitHub Desktop.
Jenkins agent connects via the SWARM plugin, or terminates.
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
#!/bin/bash | |
runuser -l jenkins -c "nohup java -jar /var/lib/jenkins/swarm-client-${swarm_version}.jar -master http://$(cat /opt/master_ip.txt):8080 -description $(cat /opt/agent_id.txt) -username admin -password $(cat /opt/api_key.txt) -name $(cat /opt/agent_id.txt) -labels $(cat /opt/agent_id.txt) -executors ${executors} -fsroot /tmp -retry 0 -disableClientsUniqueId" || aws ec2 terminate-instances --instance-ids $(cat /opt/agent_id.txt) --region ${aws_region} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment