Skip to content

Instantly share code, notes, and snippets.

@kompiro
Created Dec 15, 2011
Embed
What would you like to do?
Jenkinsのジョブを実行して、notify-sendする
#!/bin/bash
JENKINS_CLI=jenkins-cli.jar
if [ "$1" = "" ]; then
echo "Usage: build_job.sh JOB_NAME"
exit 1
fi
if [ "$JENKINS_URL" = "" ]; then
echo "Please set JENKINS_URL environment variables."
exit 1
fi
CURDIR=`dirname $0`
if [ ! -e $CURDIR/$JENKINS_CLI ]; then
echo "Downloading CLI jar"
DOWNLOAD_URL=$JENKINS_URL/jnlpJars/jenkins-cli.jar
curl -O $DOWNLOAD_URL
fi
java -jar $CURDIR/jenkins-cli.jar build -s $1 | xargs -0 notify-send
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment