Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rodrigozrusso/5e9e319a9a62787bcb88 to your computer and use it in GitHub Desktop.
Save rodrigozrusso/5e9e319a9a62787bcb88 to your computer and use it in GitHub Desktop.
#Bring back a Jenkins node thread from the ashes
# to use: export JENKINS_USERNAME="" and export JENKINS_PASSWORD=""
# Enjoy!
JENKINS_URL="http://localhost:8080";
NODE_PREFIX="ND-";
for ((node=1;node<=10;node++));
do
NODE_NAME=`printf "%s%02d" $NODE_PREFIX $node`
echo "Node number: ${NODE_NAME}";
for ((thread=0;thread<10;thread++));
do
echo "Thread number: ${thread}";
curl -X POST "${JENKINS_URL}/computer/${NODE_NAME}/executors/${thread}/yank" --user ${JENKINS_USERNAME}:${JENKINS_PASSWORD};
done;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment