Browse code

Merge pull request #17699 from jfrazelle/update-release-script-to-new-process

update release script and release process

Tianon Gravi authored on 2015/11/13 02:51:36
Showing 4 changed files
... ...
@@ -53,9 +53,6 @@ RUN apt-get update && apt-get install -y \
53 53
 	python-mock \
54 54
 	python-pip \
55 55
 	python-websocket \
56
-	reprepro \
57
-	ruby1.9.1 \
58
-	ruby1.9.1-dev \
59 56
 	s3cmd=1.1.0* \
60 57
 	ubuntu-zfs \
61 58
 	xfsprogs \
... ...
@@ -107,9 +104,6 @@ RUN git clone https://github.com/golang/lint.git /go/src/github.com/golang/lint
107 107
 	&& (cd /go/src/github.com/golang/lint && git checkout -q $GO_LINT_COMMIT) \
108 108
 	&& go install -v github.com/golang/lint/golint
109 109
 
110
-# TODO replace FPM with some very minimal debhelper stuff
111
-RUN gem install --no-rdoc --no-ri fpm --version 1.3.2
112
-
113 110
 # Install registry
114 111
 ENV REGISTRY_COMMIT ec87e9b6971d831f0eff752ddb54fb64693e51cd
115 112
 RUN set -x \
... ...
@@ -63,7 +63,6 @@ DEFAULT_BUNDLES=(
63 63
 	cover
64 64
 	cross
65 65
 	tgz
66
-	ubuntu
67 66
 )
68 67
 
69 68
 VERSION=$(< ./VERSION)
... ...
@@ -22,16 +22,12 @@ To run, I need:
22 22
   environment variables AWS_S3_BUCKET and AWS_S3_BUCKET_PATH (default: '');
23 23
 - to be provided with AWS credentials for this S3 bucket, in environment
24 24
   variables AWS_ACCESS_KEY and AWS_SECRET_KEY;
25
-- the passphrase to unlock the GPG key specified by the optional environment
26
-  variable GPG_KEYID (default: releasedocker) which will sign the deb
27
-  packages (passed as environment variable GPG_PASSPHRASE);
28 25
 - a generous amount of good will and nice manners.
29 26
 The canonical way to run me is to run the image produced by the Dockerfile: e.g.:"
30 27
 
31 28
 docker run -e AWS_S3_BUCKET=test.docker.com \
32 29
            -e AWS_ACCESS_KEY=... \
33 30
            -e AWS_SECRET_KEY=... \
34
-           -e GPG_PASSPHRASE=... \
35 31
            -i -t --privileged \
36 32
            docker ./hack/release.sh
37 33
 EOF
... ...
@@ -41,8 +37,6 @@ EOF
41 41
 [ "$AWS_S3_BUCKET" ] || usage
42 42
 [ "$AWS_ACCESS_KEY" ] || usage
43 43
 [ "$AWS_SECRET_KEY" ] || usage
44
-[ "$GPG_PASSPHRASE" ] || usage
45
-: ${GPG_KEYID:=releasedocker}
46 44
 [ -d /go/src/github.com/docker/docker ] || usage
47 45
 cd /go/src/github.com/docker/docker
48 46
 [ -x hack/make.sh ] || usage
... ...
@@ -51,7 +45,6 @@ RELEASE_BUNDLES=(
51 51
 	binary
52 52
 	cross
53 53
 	tgz
54
-	ubuntu
55 54
 )
56 55
 
57 56
 if [ "$1" != '--release-regardless-of-test-failure' ]; then
... ...
@@ -261,69 +254,6 @@ release_build() {
261 261
 	upload_release_build "$tgzDir/$tgz" "$s3Dir/$tgz" "$latestTgz"
262 262
 }
263 263
 
264
-# Upload the 'ubuntu' bundle to S3:
265
-# 1. A full APT repository is published at $BUCKET/ubuntu/
266
-# 2. Instructions for using the APT repository are uploaded at $BUCKET/ubuntu/index
267
-release_ubuntu() {
268
-	echo "Releasing ubuntu"
269
-	[ -e "bundles/$VERSION/ubuntu" ] || {
270
-		echo >&2 './hack/make.sh must be run before release_ubuntu'
271
-		exit 1
272
-	}
273
-
274
-	local debfiles=( "bundles/$VERSION/ubuntu/"*.deb )
275
-
276
-	# Sign our packages
277
-	dpkg-sig -g "--passphrase $GPG_PASSPHRASE" -k "$GPG_KEYID" --sign builder "${debfiles[@]}"
278
-
279
-	# Setup the APT repo
280
-	APTDIR=bundles/$VERSION/ubuntu/apt
281
-	mkdir -p "$APTDIR/conf" "$APTDIR/db"
282
-	s3cmd sync "s3://$BUCKET/ubuntu/db/" "$APTDIR/db/" || true
283
-	cat > "$APTDIR/conf/distributions" <<EOF
284
-Codename: docker
285
-Components: main
286
-Architectures: amd64 i386
287
-EOF
288
-
289
-	# Add the DEB package to the APT repo
290
-	reprepro -b "$APTDIR" includedeb docker "${debfiles[@]}"
291
-
292
-	# Sign
293
-	for F in $(find $APTDIR -name Release); do
294
-		gpg -u "$GPG_KEYID" --passphrase "$GPG_PASSPHRASE" \
295
-			--armor --sign --detach-sign \
296
-			--output "$F.gpg" "$F"
297
-	done
298
-
299
-	# Upload keys
300
-	s3cmd sync "$HOME/.gnupg/" "s3://$BUCKET/ubuntu/.gnupg/"
301
-	gpg --armor --export "$GPG_KEYID" > "bundles/$VERSION/ubuntu/gpg"
302
-	s3cmd --acl-public put "bundles/$VERSION/ubuntu/gpg" "s3://$BUCKET/gpg"
303
-
304
-	local gpgFingerprint=36A1D7869245C8950F966E92D8576A8BA88D21E9
305
-	local s3Headers=
306
-	if [[ $BUCKET == test* ]]; then
307
-		gpgFingerprint=740B314AE3941731B942C66ADF4FD13717AAD7D6
308
-	elif [[ $BUCKET == experimental* ]]; then
309
-		gpgFingerprint=E33FF7BF5C91D50A6F91FFFD4CC38D40F9A96B49
310
-		s3Headers='--add-header=Cache-Control:no-cache'
311
-	fi
312
-
313
-	# Upload repo
314
-	s3cmd --acl-public $s3Headers sync "$APTDIR/" "s3://$BUCKET/ubuntu/"
315
-	cat <<EOF | write_to_s3 s3://$BUCKET/ubuntu/index
316
-echo "# WARNING! This script is deprecated. Please use the script"
317
-echo "# at https://get.docker.com/"
318
-EOF
319
-
320
-	# Add redirect at /ubuntu/info for URL-backwards-compatibility
321
-	rm -rf /tmp/emptyfile && touch /tmp/emptyfile
322
-	s3cmd --acl-public --add-header='x-amz-website-redirect-location:/ubuntu/' --mime-type='text/plain' put /tmp/emptyfile "s3://$BUCKET/ubuntu/info"
323
-
324
-	echo "APT repository uploaded. Instructions available at $(s3_url)/ubuntu"
325
-}
326
-
327 264
 # Upload binaries and tgz files to S3
328 265
 release_binaries() {
329 266
 	[ -e "bundles/$VERSION/cross/linux/amd64/docker-$VERSION" ] || {
... ...
@@ -369,31 +299,10 @@ release_test() {
369 369
 	fi
370 370
 }
371 371
 
372
-setup_gpg() {
373
-	echo "Setting up GPG"
374
-	# Make sure that we have our keys
375
-	mkdir -p "$HOME/.gnupg/"
376
-	s3cmd sync "s3://$BUCKET/ubuntu/.gnupg/" "$HOME/.gnupg/" || true
377
-	gpg --list-keys "$GPG_KEYID" >/dev/null || {
378
-		gpg --gen-key --batch <<EOF
379
-Key-Type: RSA
380
-Key-Length: 4096
381
-Passphrase: $GPG_PASSPHRASE
382
-Name-Real: Docker Release Tool
383
-Name-Email: docker@docker.com
384
-Name-Comment: $GPG_KEYID
385
-Expire-Date: 0
386
-%commit
387
-EOF
388
-	}
389
-}
390
-
391 372
 main() {
392 373
 	build_all
393 374
 	setup_s3
394
-	setup_gpg
395 375
 	release_binaries
396
-	release_ubuntu
397 376
 	release_index
398 377
 	release_test
399 378
 }
... ...
@@ -407,7 +316,6 @@ echo "Use the following text to announce the release:"
407 407
 echo
408 408
 echo "We have just pushed $VERSION to $(s3_url). You can download it with the following:"
409 409
 echo
410
-echo "Ubuntu/Debian: curl -sSL $(s3_url) | sh"
411 410
 echo "Linux 64bit binary: $(s3_url)/builds/Linux/x86_64/docker-$VERSION"
412 411
 echo "Darwin/OSX 64bit client binary: $(s3_url)/builds/Darwin/x86_64/docker-$VERSION"
413 412
 echo "Darwin/OSX 32bit client binary: $(s3_url)/builds/Darwin/i386/docker-$VERSION"
... ...
@@ -203,7 +203,18 @@ That last command will give you the proper link to visit to ensure that you
203 203
 open the PR against the "release" branch instead of accidentally against
204 204
 "master" (like so many brave souls before you already have).
205 205
 
206
-### 7. Publish release candidate binaries
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
207 218
 
208 219
 To run this you will need access to the release credentials. Get them from the
209 220
 Core maintainers.
... ...
@@ -214,20 +225,19 @@ Replace "..." with the respective credentials:
214 214
 docker build -t docker .
215 215
 
216 216
 docker run \
217
-       -e AWS_S3_BUCKET=test.docker.com \
218
-       -e AWS_ACCESS_KEY="..." \
219
-       -e AWS_SECRET_KEY="..." \
220
-       -e GPG_PASSPHRASE="..." \
221
-       -i -t --privileged \
222
-       docker \
223
-       hack/release.sh
217
+    -e AWS_S3_BUCKET=test.docker.com \ # static binaries are still pushed to s3
218
+    -e AWS_ACCESS_KEY="..." \
219
+    -e AWS_SECRET_KEY="..." \
220
+    -i -t --privileged \
221
+    docker \
222
+    hack/release.sh
224 223
 ```
225 224
 
226
-It will run the test suite, build the binaries and packages, and upload to the
227
-specified bucket, so this is a good time to verify that you're running against
228
-**test**.docker.com.
225
+It will run the test suite, build the binaries and upload to the specified bucket,
226
+so this is a good time to verify that you're running against **test**.docker.com.
229 227
 
230
-After the binaries and packages are uploaded to test.docker.com, make sure
228
+After the binaries are uploaded to test.docker.com and the packages are on
229
+apt.dockerproject.org and yum.dockerproject.org, make sure
231 230
 they get tested in both Ubuntu and Debian for any obvious installation
232 231
 issues or runtime issues.
233 232
 
... ...
@@ -242,7 +252,7 @@ Announcing on multiple medias is the best way to get some help testing! An easy
242 242
 way to get some useful links for sharing:
243 243
 
244 244
 ```bash
245
-echo "Ubuntu/Debian: https://test.docker.com/ubuntu or curl -sSL https://test.docker.com/ | sh"
245
+echo "Ubuntu/Debian: curl -sSL https://test.docker.com/ | sh"
246 246
 echo "Linux 64bit binary: https://test.docker.com/builds/Linux/x86_64/docker-${VERSION#v}"
247 247
 echo "Darwin/OSX 64bit client binary: https://test.docker.com/builds/Darwin/x86_64/docker-${VERSION#v}"
248 248
 echo "Darwin/OSX 32bit client binary: https://test.docker.com/builds/Darwin/i386/docker-${VERSION#v}"
... ...
@@ -257,7 +267,7 @@ We recommend announcing the release candidate on:
257 257
 - The [docker-maintainers](https://groups.google.com/a/dockerproject.org/forum/#!forum/maintainers) group
258 258
 - Any social media that can bring some attention to the release candidate
259 259
 
260
-### 8. Iterate on successive release candidates
260
+### 9. Iterate on successive release candidates
261 261
 
262 262
 Spend several days along with the community explicitly investing time and
263 263
 resources to try and break Docker in every possible way, documenting any
... ...
@@ -307,7 +317,7 @@ git push -f $GITHUBUSER bump_$VERSION
307 307
 Repeat step 6 to tag the code, publish new binaries, announce availability, and
308 308
 get help testing.
309 309
 
310
-### 9. Finalize the bump branch
310
+### 10. Finalize the bump branch
311 311
 
312 312
 When you're happy with the quality of a release candidate, you can move on and
313 313
 create the real thing.
... ...
@@ -323,25 +333,36 @@ git commit --amend
323 323
 
324 324
 You will then repeat step 6 to publish the binaries to test
325 325
 
326
-### 10. Get 2 other maintainers to validate the pull request
326
+### 11. Get 2 other maintainers to validate the pull request
327 327
 
328
-### 11. Publish final binaries
328
+### 12. Build final rpms and debs
329
+
330
+```bash
331
+docker build -t docker .
332
+docker run \
333
+    --rm -t --privileged \
334
+    -v $(pwd)/bundles:/go/src/github.com/docker/docker/bundles \
335
+    docker \
336
+    hack/make.sh binary build-deb build-rpm
337
+```
338
+
339
+### 13. Publish final binaries
329 340
 
330 341
 Once they're tested and reasonably believed to be working, run against
331 342
 get.docker.com:
332 343
 
333 344
 ```bash
345
+docker build -t docker .
334 346
 docker run \
335
-       -e AWS_S3_BUCKET=get.docker.com \
336
-       -e AWS_ACCESS_KEY="..." \
337
-       -e AWS_SECRET_KEY="..." \
338
-       -e GPG_PASSPHRASE="..." \
339
-       -i -t --privileged \
340
-       docker \
341
-       hack/release.sh
347
+    -e AWS_S3_BUCKET=get.docker.com \ # static binaries are still pushed to s3
348
+    -e AWS_ACCESS_KEY="..." \
349
+    -e AWS_SECRET_KEY="..." \
350
+    -i -t --privileged \
351
+    docker \
352
+    hack/release.sh
342 353
 ```
343 354
 
344
-### 12. Apply tag and create release
355
+### 14. Apply tag and create release
345 356
 
346 357
 It's very important that we don't make the tag until after the official
347 358
 release is uploaded to get.docker.com!
... ...
@@ -360,12 +381,12 @@ You can see examples in this two links:
360 360
 https://github.com/docker/docker/releases/tag/v1.8.0
361 361
 https://github.com/docker/docker/releases/tag/v1.8.0-rc3
362 362
 
363
-### 13. Go to github to merge the `bump_$VERSION` branch into release
363
+### 15. Go to github to merge the `bump_$VERSION` branch into release
364 364
 
365 365
 Don't forget to push that pretty blue button to delete the leftover
366 366
 branch afterwards!
367 367
 
368
-### 14. Update the docs branch
368
+### 16. Update the docs branch
369 369
 
370 370
 You will need to point the docs branch to the newly created release tag:
371 371
 
... ...
@@ -384,7 +405,7 @@ distributed CDN system) is flushed. The `make docs-release` command will do this
384 384
 _if_ the `DISTRIBUTION_ID` is set correctly - this will take at least 15 minutes to run
385 385
 and you can check its progress with the CDN Cloudfront Chrome addon.
386 386
 
387
-### 15. Create a new pull request to merge your bump commit back into master
387
+### 17. Create a new pull request to merge your bump commit back into master
388 388
 
389 389
 ```bash
390 390
 git checkout master
... ...
@@ -398,14 +419,14 @@ echo "https://github.com/$GITHUBUSER/docker/compare/docker:master...$GITHUBUSER:
398 398
 Again, get two maintainers to validate, then merge, then push that pretty
399 399
 blue button to delete your branch.
400 400
 
401
-### 16. Update the VERSION files
401
+### 18. Update the VERSION files
402 402
 
403 403
 Now that version X.Y.Z is out, time to start working on the next! Update the
404 404
 content of the `VERSION` file to be the next minor (incrementing Y) and add the
405 405
 `-dev` suffix. For example, after 1.5.0 release, the `VERSION` file gets
406 406
 updated to `1.6.0-dev` (as in "1.6.0 in the making").
407 407
 
408
-### 17. Rejoice and Evangelize!
408
+### 19. Rejoice and Evangelize!
409 409
 
410 410
 Congratulations! You're done.
411 411