Skip to content

Instantly share code, notes, and snippets.

@tijmenb
Created July 6, 2016 16:10
Show Gist options
  • Save tijmenb/64000dad8e1276b45879e0af7188fd81 to your computer and use it in GitHub Desktop.
Save tijmenb/64000dad8e1276b45879e0af7188fd81 to your computer and use it in GitHub Desktop.
#!/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