Created
March 6, 2011 22:11
-
-
Save hamishcampbell/857751 to your computer and use it in GitHub Desktop.
Simple Bash script to automate updating of SilverStripe build submodules.
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
branches=( master 2.4 ) | |
modules=( sapphire cms themes ) | |
for branch in "${branches[@]}" | |
do | |
echo "================" | |
echo "Updating $branch" | |
echo "----------------" | |
echo " * pull" | |
git pull 1> /dev/null | |
echo " * checkout" | |
git checkout $branch 1> /dev/null | |
echo " * Updating submodules" | |
for module in "${modules[@]}" | |
do | |
echo " * $module" | |
cd $module | |
git checkout $branch 1> /dev/null | |
git pull 1> /dev/null | |
cd .. | |
done | |
echo " * Commit" | |
git commit -a -m "AUTO UPDATE: Updated submodules ($branch)" 1> /dev/null | |
git push origin $branch | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment