Created
January 30, 2014 22:25
-
-
Save ITBlogger/8721349 to your computer and use it in GitHub Desktop.
Git rsync from /var/staging -- No longer used, but keeping if needed in future
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
#!/bin/bash | |
rsync -vrlptgo /var/staging/hiera/hiera/ /var/lib/hiera/ --chmod=Du+rwx,go=rx,Fu+rw,go=r --del | |
chown -R root:root /var/lib/hiera | |
for environment in `ls /var/staging/environments` | |
do | |
echo "this is environment ${environment}" | |
cd /var/staging/environments/${environment} | |
commit=`git log -1 | grep commit` | |
echo "${commit}" | |
echo `cat /var/staging/${environment}-commit` | |
if [ "${commit}" == "`cat /var/staging/${environment}-commit`" ] | |
then | |
echo "no changes, skipping" | |
else | |
echo "changes made, syncing" | |
rsync -vrlptgo /var/staging/environments/${environment}/ /etc/puppetlabs/puppet/environments/${environment} --chmod=Du+rwx,Dgo=rx,Fu=rw,Fgo=r --del | |
chown -R root:pe-puppet /etc/puppetlabs/puppet/environments/${environment} | |
git log -1 | grep commit > /var/staging/${environment}-commit | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment