Created
June 22, 2014 21:21
-
-
Save rchrd2/bc6f8f17705c00b19481 to your computer and use it in GitHub Desktop.
example puppet unless for git changes
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
exec { 'pull-changes': | |
# This unless command makes it so this exec only runs when the branch is behind the head | |
unless => [ | |
"/bin/bash -c 'cd /var/www/django/django \ | |
&& CURRBRANCH=$(/usr/bin/git rev-parse --abbrev-ref HEAD)\ | |
&& /usr/bin/git fetch origin \$CURRBRANCH \ | |
&& /usr/bin/git rev-list HEAD...origin/\$CURRBRANCH --count'\ | |
| /bin/grep '0'" | |
], | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment