Browse code

Make the release process more atomic between major releases.

Rather than keeping a branch named "release" where we merge every release,
we want to keep "disposable" release branches for each release.

This will make much easier to create new major releases, since we always
want to start these releases from what we have in master. We create a
disposable release branch from master that we'll only use during the lifecycle
of the major release.

Once the release branch is created, the release captain will use a "bump" branch
in her own fork to cherry pick changes that will need to be applied to this
release. We'll track those changes in a pull request between the disposable release
branch and the bump branch.

Signed-off-by: David Calavera <david.calavera@gmail.com>

David Calavera authored on 2015/07/28 08:36:57
Showing 1 changed files
... ...
@@ -24,22 +24,49 @@ git remote add $GITHUBUSER git@github.com:$GITHUBUSER/docker.git
24 24
 
25 25
 ### 1. Pull from master and create a release branch
26 26
 
27
-Note: Even for major releases, all of X, Y and Z in vX.Y.Z must be specified (e.g. v1.0.0).
27
+All releases version numbers will be of the form: vX.Y.Z  where X is the major
28
+version number, Y is the minor version number and Z is the patch release version number.
29
+
30
+#### Major releases
31
+
32
+The release branch name is just vX.Y because it's going to be the basis for all .Z releases.
28 33
 
29 34
 ```bash
35
+export BASE=vX.Y
30 36
 export VERSION=vX.Y.Z
31 37
 git fetch origin
32
-git branch -D release || true
33
-git checkout --track origin/release
38
+git checkout --track origin/master
39
+git checkout -b release/$BASE
40
+```
41
+
42
+This new branch is going to be the base for the release. We need to push it to origin so we
43
+can track the cherry-picked changes and the version bump:
44
+
45
+```bash
46
+git push origin release/$BASE
47
+```
48
+
49
+When you have the major release branch in origin, we need to create the bump fork branch
50
+that we'll push to our fork:
51
+
52
+```bash
34 53
 git checkout -b bump_$VERSION
35 54
 ```
36 55
 
37
-If it's a regular release, we usually merge master.
56
+#### Patch releases
57
+
58
+If we have the release branch in origin, we can create the forked bump branch from it directly:
59
+
38 60
 ```bash
39
-git merge origin/master
61
+export VERSION=vX.Y.Z
62
+export PATCH=vX.Y.Z+1
63
+git fetch origin
64
+git checkout --track origin/release/$BASE
65
+git checkout -b bump_$PATCH
40 66
 ```
41 67
 
42
-Otherwise, if it is a hotfix release, we cherry-pick only the commits we want.
68
+We cherry-pick only the commits we want into the bump branch:
69
+
43 70
 ```bash
44 71
 # get the commits ids we want to cherry-pick
45 72
 git log
... ...
@@ -169,7 +196,7 @@ make AWS_S3_BUCKET=beta-docs.docker.io BUILD_ROOT=yes docs-release
169 169
 git add VERSION CHANGELOG.md
170 170
 git commit -m "Bump version to $VERSION"
171 171
 git push $GITHUBUSER bump_$VERSION
172
-echo "https://github.com/$GITHUBUSER/docker/compare/docker:release...$GITHUBUSER:bump_$VERSION?expand=1"
172
+echo "https://github.com/$GITHUBUSER/docker/compare/docker:release/$BASE...$GITHUBUSER:bump_$VERSION?expand=1"
173 173
 ```
174 174
 
175 175
 That last command will give you the proper link to visit to ensure that you
... ...
@@ -185,6 +212,7 @@ Replace "..." with the respective credentials:
185 185
 
186 186
 ```bash
187 187
 docker build -t docker .
188
+
188 189
 docker run \
189 190
        -e AWS_S3_BUCKET=test.docker.com \
190 191
        -e AWS_ACCESS_KEY="..." \