Created
January 27, 2020 01:02
-
-
Save tzmfreedom/4080d1499ce8bca08c9e134386494d2c to your computer and use it in GitHub Desktop.
bundle_update
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 -ue | |
git checkout master | |
current_branch=`git rev-parse --abbrev-ref HEAD` | |
if [[ ${current_branch} != master ]]; then | |
echo "Error: current branch is ${current_branch}" | |
exit 1 | |
fi | |
branch=bundle-update_`date "+%Y%m%d"` | |
message="bundle update at $(date '+%Y/%m/%d')" | |
git fetch origin | |
git merge origin/master | |
git checkout -b ${branch} | |
bundle update | |
git add Gemfile.lock | |
git commit -m "${message}" | |
git push origin ${branch} | |
body=$( | |
bundle exec compare-linker-wrapper "./Gemfile.lock" \ | |
--base origin/master \ | |
--formatter CompareLinker::Formatter::Markdown | |
) | |
bundle exec pull-request-create create \ | |
--title "${message}" \ | |
--body "${body}" \ | |
--head "${branch}" | |
git checkout master | |
git branch -D "${branch}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment