Skip to content

Instantly share code, notes, and snippets.

@kompiro
Created December 15, 2011 07:10
Show Gist options
  • Save kompiro/1480152 to your computer and use it in GitHub Desktop.
Save kompiro/1480152 to your computer and use it in GitHub Desktop.
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