Skip to content

Instantly share code, notes, and snippets.

@hamishcampbell
Created March 6, 2011 22:11
Show Gist options
  • Save hamishcampbell/857751 to your computer and use it in GitHub Desktop.
Save hamishcampbell/857751 to your computer and use it in GitHub Desktop.
Simple Bash script to automate updating of SilverStripe build submodules.
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