Skip to content

Instantly share code, notes, and snippets.

@sdqali
Created February 3, 2012 21:45
Show Gist options
  • Save sdqali/1732873 to your computer and use it in GitHub Desktop.
Save sdqali/1732873 to your computer and use it in GitHub Desktop.
#/usr/bin/env bash
JENKINS_HOME=/var/lib/jenkins
cd $JENKINS_HOME
git add *.xml jobs/*/config.xml users/*/config.xml userContent/*
CHANGES_TO_BE_COMMITTED=$(git status | grep "^# Changes to be committed:" | wc -l)
if [ $CHANGES_TO_BE_COMMITTED -eq 0 ]; then
echo "Nothing to commit"
else
git commit -m "Automated commit of Jenkins configuration at $(date)"
git push origin master
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment