Created
July 6, 2016 16:10
-
-
Save tijmenb/64000dad8e1276b45879e0af7188fd81 to your computer and use it in GitHub Desktop.
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 | |
set -ex | |
bundle_update_for_repo() { | |
git clone git@github.com:alphagov/$1.git --depth=1 | |
cd $1 | |
git checkout -b "update-dependencies-$(date +"%Y-%m-%d")" | |
BUNDLE_UPDATE_LOG="$(bundle update --jobs=4 | grep was)" | |
BUNDLE_OUTDATED_LOG="$(bundle outdated | grep group)" || true | |
git add Gemfile.lock | |
git commit -F- <<EOF | |
Update dependencies ($(date +"%Y-%m-%d")) | |
This commit contains Gem updates with bundle update. | |
## Updated gems | |
$BUNDLE_UPDATE_LOG | |
## Currently outdated gems | |
$BUNDLE_OUTDATED_LOG | |
EOF | |
git push | |
# Clean up the directory | |
cd .. | |
rm -rf $1 | |
} | |
repos=( | |
'policy-publisher' | |
) | |
for repo_name in "${repos[@]}"; do | |
bundle_update_for_repo "${repo_name}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment