github.com/walkingsparrow/docker@v1.4.2-0.20151218153551-b708a2249bfa/project/RELEASE-CHECKLIST.md (about) 1 # Release Checklist 2 ## A maintainer's guide to releasing Docker 3 4 So you're in charge of a Docker release? Cool. Here's what to do. 5 6 If your experience deviates from this document, please document the changes 7 to keep it up-to-date. 8 9 It is important to note that this document assumes that the git remote in your 10 repository that corresponds to "https://github.com/docker/docker" is named 11 "origin". If yours is not (for example, if you've chosen to name it "upstream" 12 or something similar instead), be sure to adjust the listed snippets for your 13 local environment accordingly. If you are not sure what your upstream remote is 14 named, use a command like `git remote -v` to find out. 15 16 If you don't have an upstream remote, you can add one easily using something 17 like: 18 19 ```bash 20 export GITHUBUSER="YOUR_GITHUB_USER" 21 git remote add origin https://github.com/docker/docker.git 22 git remote add $GITHUBUSER git@github.com:$GITHUBUSER/docker.git 23 ``` 24 25 ### 1. Pull from master and create a release branch 26 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. 33 34 ```bash 35 export BASE=vX.Y 36 export VERSION=vX.Y.Z 37 git fetch origin 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 53 git checkout -b bump_$VERSION 54 ``` 55 56 #### Patch releases 57 58 If we have the release branch in origin, we can create the forked bump branch from it directly: 59 60 ```bash 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 66 ``` 67 68 We cherry-pick only the commits we want into the bump branch: 69 70 ```bash 71 # get the commits ids we want to cherry-pick 72 git log 73 # cherry-pick the commits starting from the oldest one, without including merge commits 74 git cherry-pick <commit-id> 75 git cherry-pick <commit-id> 76 ... 77 ``` 78 79 ### 2. Bump the API version on master 80 81 We don't want to stop contributions to master just because we are releasing. At 82 the same time, now that the release branch exists, we don't want API changes to 83 go to the now frozen API version. 84 85 Create a new entry in `docs/reference/api/` by copying the latest and 86 bumping the version number (in both the file's name and content), and submit 87 this in a PR against master. 88 89 ### 3. Update CHANGELOG.md 90 91 You can run this command for reference with git 2.0: 92 93 ```bash 94 git fetch --tags 95 LAST_VERSION=$(git tag -l --sort=-version:refname "v*" | grep -E 'v[0-9\.]+$' | head -1) 96 git log --stat $LAST_VERSION..bump_$VERSION 97 ``` 98 99 If you don't have git 2.0 but have a sort command that supports `-V`: 100 ```bash 101 git fetch --tags 102 LAST_VERSION=$(git tag -l | grep -E 'v[0-9\.]+$' | sort -rV | head -1) 103 git log --stat $LAST_VERSION..bump_$VERSION 104 ``` 105 106 If releasing a major version (X or Y increased in vX.Y.Z), simply listing notable user-facing features is sufficient. 107 ```markdown 108 #### Notable features since <last major version> 109 * New docker command to do something useful 110 * Remote API change (deprecating old version) 111 * Performance improvements in some usecases 112 * ... 113 ``` 114 115 For minor releases (only Z increases in vX.Y.Z), provide a list of user-facing changes. 116 Each change should be listed under a category heading formatted as `#### CATEGORY`. 117 118 `CATEGORY` should describe which part of the project is affected. 119 Valid categories are: 120 * Builder 121 * Documentation 122 * Hack 123 * Packaging 124 * Remote API 125 * Runtime 126 * Other (please use this category sparingly) 127 128 Each change should be formatted as `BULLET DESCRIPTION`, given: 129 130 * BULLET: either `-`, `+` or `*`, to indicate a bugfix, new feature or 131 upgrade, respectively. 132 133 * DESCRIPTION: a concise description of the change that is relevant to the 134 end-user, using the present tense. Changes should be described in terms 135 of how they affect the user, for example "Add new feature X which allows Y", 136 "Fix bug which caused X", "Increase performance of Y". 137 138 EXAMPLES: 139 140 ```markdown 141 ## 0.3.6 (1995-12-25) 142 143 #### Builder 144 145 + 'docker build -t FOO .' applies the tag FOO to the newly built image 146 147 #### Remote API 148 149 - Fix a bug in the optional unix socket transport 150 151 #### Runtime 152 153 * Improve detection of kernel version 154 ``` 155 156 If you need a list of contributors between the last major release and the 157 current bump branch, use something like: 158 ```bash 159 git log --format='%aN <%aE>' v0.7.0...bump_v0.8.0 | sort -uf 160 ``` 161 Obviously, you'll need to adjust version numbers as necessary. If you just need 162 a count, add a simple `| wc -l`. 163 164 ### 4. Change the contents of the VERSION file 165 166 Before the big thing, you'll want to make successive release candidates and get 167 people to test. The release candidate number `N` should be part of the version: 168 169 ```bash 170 export RC_VERSION=${VERSION}-rcN 171 echo ${RC_VERSION#v} > VERSION 172 ``` 173 174 ### 5. Test the docs 175 176 Make sure that your tree includes documentation for any modified or 177 new features, syntax or semantic changes. 178 179 To test locally: 180 181 ```bash 182 make docs 183 ``` 184 185 To make a shared test at https://beta-docs.docker.io: 186 187 (You will need the `awsconfig` file added to the `docs/` dir) 188 189 ```bash 190 make AWS_S3_BUCKET=beta-docs.docker.io BUILD_ROOT=yes docs-release 191 ``` 192 193 ### 6. Commit and create a pull request to the "release" branch 194 195 ```bash 196 git add VERSION CHANGELOG.md 197 git commit -m "Bump version to $VERSION" 198 git push $GITHUBUSER bump_$VERSION 199 echo "https://github.com/$GITHUBUSER/docker/compare/docker:release/$BASE...$GITHUBUSER:bump_$VERSION?expand=1" 200 ``` 201 202 That last command will give you the proper link to visit to ensure that you 203 open the PR against the "release" branch instead of accidentally against 204 "master" (like so many brave souls before you already have). 205 206 ### 7. Build release candidate rpms and debs 207 208 ```bash 209 docker build -t docker . 210 docker run \ 211 --rm -t --privileged \ 212 -v $(pwd)/bundles:/go/src/github.com/docker/docker/bundles \ 213 docker \ 214 hack/make.sh binary build-deb build-rpm 215 ``` 216 217 ### 8. Publish release candidate binaries 218 219 To run this you will need access to the release credentials. Get them from the 220 Core maintainers. 221 222 Replace "..." with the respective credentials: 223 224 ```bash 225 docker build -t docker . 226 227 docker run \ 228 -e AWS_S3_BUCKET=test.docker.com \ # static binaries are still pushed to s3 229 -e AWS_ACCESS_KEY="..." \ 230 -e AWS_SECRET_KEY="..." \ 231 -i -t --privileged \ 232 docker \ 233 hack/release.sh 234 ``` 235 236 It will run the test suite, build the binaries and upload to the specified bucket, 237 so this is a good time to verify that you're running against **test**.docker.com. 238 239 After the binaries are uploaded to test.docker.com and the packages are on 240 apt.dockerproject.org and yum.dockerproject.org, make sure 241 they get tested in both Ubuntu and Debian for any obvious installation 242 issues or runtime issues. 243 244 If everything looks good, it's time to create a git tag for this candidate: 245 246 ```bash 247 git tag -a $RC_VERSION -m $RC_VERSION bump_$VERSION 248 git push origin $RC_VERSION 249 ``` 250 251 Announcing on multiple medias is the best way to get some help testing! An easy 252 way to get some useful links for sharing: 253 254 ```bash 255 echo "Ubuntu/Debian: curl -sSL https://test.docker.com/ | sh" 256 echo "Linux 64bit binary: https://test.docker.com/builds/Linux/x86_64/docker-${VERSION#v}" 257 echo "Darwin/OSX 64bit client binary: https://test.docker.com/builds/Darwin/x86_64/docker-${VERSION#v}" 258 echo "Darwin/OSX 32bit client binary: https://test.docker.com/builds/Darwin/i386/docker-${VERSION#v}" 259 echo "Linux 64bit tgz: https://test.docker.com/builds/Linux/x86_64/docker-${VERSION#v}.tgz" 260 ``` 261 262 We recommend announcing the release candidate on: 263 264 - IRC on #docker, #docker-dev, #docker-maintainers 265 - In a comment on the pull request to notify subscribed people on GitHub 266 - The [docker-dev](https://groups.google.com/forum/#!forum/docker-dev) group 267 - The [docker-maintainers](https://groups.google.com/a/dockerproject.org/forum/#!forum/maintainers) group 268 - Any social media that can bring some attention to the release candidate 269 270 ### 9. Iterate on successive release candidates 271 272 Spend several days along with the community explicitly investing time and 273 resources to try and break Docker in every possible way, documenting any 274 findings pertinent to the release. This time should be spent testing and 275 finding ways in which the release might have caused various features or upgrade 276 environments to have issues, not coding. During this time, the release is in 277 code freeze, and any additional code changes will be pushed out to the next 278 release. 279 280 It should include various levels of breaking Docker, beyond just using Docker 281 by the book. 282 283 Any issues found may still remain issues for this release, but they should be 284 documented and give appropriate warnings. 285 286 During this phase, the `bump_$VERSION` branch will keep evolving as you will 287 produce new release candidates. The frequency of new candidates is up to the 288 release manager: use your best judgement taking into account the severity of 289 reported issues, testers availability, and time to scheduled release date. 290 291 Each time you'll want to produce a new release candidate, you will start by 292 adding commits to the branch, usually by cherry-picking from master: 293 294 ```bash 295 git cherry-pick -x -m0 <commit_id> 296 ``` 297 298 You want your "bump commit" (the one that updates the CHANGELOG and VERSION 299 files) to remain on top, so you'll have to `git rebase -i` to bring it back up. 300 301 Now that your bump commit is back on top, you will need to update the CHANGELOG 302 file (if appropriate for this particular release candidate), and update the 303 VERSION file to increment the RC number: 304 305 ```bash 306 export RC_VERSION=$VERSION-rcN 307 echo $RC_VERSION > VERSION 308 ``` 309 310 You can now amend your last commit and update the bump branch: 311 312 ```bash 313 git commit --amend 314 git push -f $GITHUBUSER bump_$VERSION 315 ``` 316 317 Repeat step 6 to tag the code, publish new binaries, announce availability, and 318 get help testing. 319 320 ### 10. Finalize the bump branch 321 322 When you're happy with the quality of a release candidate, you can move on and 323 create the real thing. 324 325 You will first have to amend the "bump commit" to drop the release candidate 326 suffix in the VERSION file: 327 328 ```bash 329 echo $VERSION > VERSION 330 git add VERSION 331 git commit --amend 332 ``` 333 334 You will then repeat step 6 to publish the binaries to test 335 336 ### 11. Get 2 other maintainers to validate the pull request 337 338 ### 12. Build final rpms and debs 339 340 ```bash 341 docker build -t docker . 342 docker run \ 343 --rm -t --privileged \ 344 -v $(pwd)/bundles:/go/src/github.com/docker/docker/bundles \ 345 docker \ 346 hack/make.sh binary build-deb build-rpm 347 ``` 348 349 ### 13. Publish final binaries 350 351 Once they're tested and reasonably believed to be working, run against 352 get.docker.com: 353 354 ```bash 355 docker build -t docker . 356 docker run \ 357 -e AWS_S3_BUCKET=get.docker.com \ # static binaries are still pushed to s3 358 -e AWS_ACCESS_KEY="..." \ 359 -e AWS_SECRET_KEY="..." \ 360 -i -t --privileged \ 361 docker \ 362 hack/release.sh 363 ``` 364 365 ### 14. Apply tag and create release 366 367 It's very important that we don't make the tag until after the official 368 release is uploaded to get.docker.com! 369 370 ```bash 371 git tag -a $VERSION -m $VERSION bump_$VERSION 372 git push origin $VERSION 373 ``` 374 375 Once the tag is pushed, go to GitHub and create a [new release](https://github.com/docker/docker/releases/new). 376 If the tag is for an RC make sure you check `This is a pre-release` at the bottom of the form. 377 378 Select the tag that you just pushed as the version and paste the changelog in the description of the release. 379 You can see examples in this two links: 380 381 https://github.com/docker/docker/releases/tag/v1.8.0 382 https://github.com/docker/docker/releases/tag/v1.8.0-rc3 383 384 ### 15. Go to github to merge the `bump_$VERSION` branch into release 385 386 Don't forget to push that pretty blue button to delete the leftover 387 branch afterwards! 388 389 ### 16. Update the docs branch 390 391 You will need to point the docs branch to the newly created release tag: 392 393 ```bash 394 git checkout origin/docs 395 git reset --hard origin/$VERSION 396 git push -f origin docs 397 ``` 398 399 The docs will appear on https://docs.docker.com/ (though there may be cached 400 versions, so its worth checking http://docs.docker.com.s3-website-us-east-1.amazonaws.com/). 401 For more information about documentation releases, see `docs/README.md`. 402 403 Note that the new docs will not appear live on the site until the cache (a complex, 404 distributed CDN system) is flushed. The `make docs-release` command will do this 405 _if_ the `DISTRIBUTION_ID` is set correctly - this will take at least 15 minutes to run 406 and you can check its progress with the CDN Cloudfront Chrome addon. 407 408 ### 17. Create a new pull request to merge your bump commit back into master 409 410 ```bash 411 git checkout master 412 git fetch 413 git reset --hard origin/master 414 git cherry-pick $VERSION 415 git push $GITHUBUSER merge_release_$VERSION 416 echo "https://github.com/$GITHUBUSER/docker/compare/docker:master...$GITHUBUSER:merge_release_$VERSION?expand=1" 417 ``` 418 419 Again, get two maintainers to validate, then merge, then push that pretty 420 blue button to delete your branch. 421 422 ### 18. Update the VERSION files 423 424 Now that version X.Y.Z is out, time to start working on the next! Update the 425 content of the `VERSION` file to be the next minor (incrementing Y) and add the 426 `-dev` suffix. For example, after 1.5.0 release, the `VERSION` file gets 427 updated to `1.6.0-dev` (as in "1.6.0 in the making"). 428 429 ### 19. Rejoice and Evangelize! 430 431 Congratulations! You're done. 432 433 Go forth and announce the glad tidings of the new release in `#docker`, 434 `#docker-dev`, on the [dev mailing list](https://groups.google.com/forum/#!forum/docker-dev), 435 the [announce mailing list](https://groups.google.com/forum/#!forum/docker-announce), 436 and on Twitter!