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
96
script/release/make-branch
Executable file
96
script/release/make-branch
Executable file
|
|
@ -0,0 +1,96 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Prepare a new release branch
|
||||
#
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
. script/release/utils.sh
|
||||
|
||||
REPO=git@github.com:docker/compose
|
||||
|
||||
|
||||
function usage() {
|
||||
>&2 cat << EOM
|
||||
Create a new release branch `release-<version>`
|
||||
|
||||
Usage:
|
||||
|
||||
$0 <version> [<base_version>]
|
||||
|
||||
Options:
|
||||
|
||||
version version string for the release (ex: 1.6.0)
|
||||
base_version branch or tag to start from. Defaults to master. For
|
||||
bug-fix releases use the previous stage release tag.
|
||||
|
||||
EOM
|
||||
exit 1
|
||||
}
|
||||
|
||||
[ -n "$1" ] || usage
|
||||
VERSION=$1
|
||||
BRANCH=bump-$VERSION
|
||||
|
||||
if [ -z "$2" ]; then
|
||||
BASE_VERSION="master"
|
||||
else
|
||||
BASE_VERSION=$2
|
||||
fi
|
||||
|
||||
|
||||
DEFAULT_REMOTE=release
|
||||
REMOTE=$(find_remote $REPO)
|
||||
# If we don't have a docker origin add one
|
||||
if [ -z "$REMOTE" ]; then
|
||||
echo "Creating $DEFAULT_REMOTE remote"
|
||||
git remote add ${DEFAULT_REMOTE} ${REPO}
|
||||
fi
|
||||
|
||||
# handle the difference between a branch and a tag
|
||||
if [ -z "$(git name-rev $BASE_VERSION | grep tags)" ]; then
|
||||
BASE_VERSION=$REMOTE/$BASE_VERSION
|
||||
fi
|
||||
|
||||
echo "Creating a release branch $VERSION from $BASE_VERSION"
|
||||
read -n1 -r -p "Continue? (ctrl+c to cancel)"
|
||||
git fetch $REMOTE -p
|
||||
git checkout -b $BRANCH $BASE_VERSION
|
||||
|
||||
|
||||
# Store the release version for this branch in git, so that other release
|
||||
# scripts can use it
|
||||
git config "branch.${BRANCH}.release" $VERSION
|
||||
|
||||
|
||||
echo "Update versions in docs/install.md and compose/__init__.py"
|
||||
# TODO: automate this
|
||||
$EDITOR docs/install.md
|
||||
$EDITOR compose/__init__.py
|
||||
|
||||
|
||||
echo "Write release notes in CHANGELOG.md"
|
||||
browser "https://github.com/docker/compose/issues?q=milestone%3A$VERSION+is%3Aclosed"
|
||||
$EDITOR CHANGELOG.md
|
||||
|
||||
|
||||
echo "Verify changes before commit. Exit the shell to commit changes"
|
||||
git diff
|
||||
$SHELL
|
||||
git commit -a -m "Bump $VERSION" --signoff
|
||||
|
||||
|
||||
echo "Push branch to user remote"
|
||||
GITHUB_USER=$USER
|
||||
USER_REMOTE=$(find_remote $GITHUB_USER/compose)
|
||||
if [ -z "$USER_REMOTE" ]; then
|
||||
echo "No user remote found for $GITHUB_USER"
|
||||
read -n1 -r -p "Enter the name of your github user: " GITHUB_USER
|
||||
# assumes there is already a user remote somewhere
|
||||
USER_REMOTE=$(find_remote $GITHUB_USER/compose)
|
||||
fi
|
||||
|
||||
|
||||
git push $USER_REMOTE
|
||||
browser https://github.com/docker/compose/compare/docker:release...$GITHUB_USER:$BRANCH?expand=1
|
||||
Loading…
Add table
Add a link
Reference in a new issue