Add scripts for automating parts of the release.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
parent
5b95c989cd
commit
da91b81bb8
6 changed files with 269 additions and 42 deletions
39
script/release/rebase-bump-commit
Executable file
39
script/release/rebase-bump-commit
Executable file
|
|
@ -0,0 +1,39 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Move the "bump to <version>" commit to the HEAD of the branch
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
|
||||
function usage() {
|
||||
>&2 cat << EOM
|
||||
Move the "bump to <version>" commit to the HEAD of the branch
|
||||
|
||||
This script requires that 'git config branch.${BRANCH}.release' is set to the
|
||||
release version for the release branch.
|
||||
|
||||
EOM
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
BRANCH="$(git rev-parse --abbrev-ref HEAD)"
|
||||
VERSION="$(git config "branch.${BRANCH}.release")" || usage
|
||||
|
||||
|
||||
COMMIT_MSG="Bump $VERSION"
|
||||
sha=$(git log --grep $COMMIT_MSG --format="%H")
|
||||
if [ -z "$sha" ]; then
|
||||
>&2 echo "No commit with message \"$COMMIT_MSG\""
|
||||
exit 2
|
||||
fi
|
||||
if [[ "$sha" == "$(git rev-parse HEAD)" ]]; then
|
||||
>&2 echo "Bump commit already at HEAD"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
commits=$(git log --format="%H" HEAD..$sha | wc -l)
|
||||
|
||||
git rebase --onto $sha~1 HEAD~$commits $BRANCH
|
||||
git cherry-pick $sha
|
||||
Loading…
Add table
Add a link
Reference in a new issue