Skip to content

Commit 6fd4cd9

Browse files
committed
update release documentation
1 parent ccefbf8 commit 6fd4cd9

File tree

2 files changed

+33
-39
lines changed

2 files changed

+33
-39
lines changed

build/release.sh

+11-5
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,25 @@ build/build.sh
4242

4343
# Build the docker image
4444
echo ">> building cadvisor docker image"
45-
docker_tag="google/cadvisor:$VERSION"
4645
gcr_tag="gcr.io/cadvisor/cadvisor:$VERSION"
47-
docker build -t $docker_tag -t $gcr_tag -f deploy/Dockerfile .
46+
docker build -t $gcr_tag -f deploy/Dockerfile .
4847

4948
# Build the release binary without libpfm4 to not require libpfm4 in runtime environment
5049
unset GO_FLAGS
5150
build/build.sh
5251

5352
echo
54-
echo "Release info:"
53+
echo "double-check the version below:"
5554
echo "VERSION=$VERSION"
55+
echo
56+
echo "To push docker image to gcr:"
57+
echo "docker push $gcr_tag"
58+
echo
59+
echo "Release info (copy to the release page):"
60+
echo
61+
echo "Docker Image: N/A"
62+
echo "gcr.io Image: $gcr_tag"
63+
echo
5664
sha256sum --tag cadvisor
57-
echo "docker image: $docker_tag"
58-
echo "gcr.io image: $gcr_tag"
5965

6066
exit 0

docs/development/releasing.md

+22-34
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# cAdvisor Release Instructions
22

3-
Google internal-only version: [cAdvisor Release Instructions](http://go/cadvisor-release-instructions)
4-
53
## 1. Send Release PR
64

75
Example: https://github.com/google/cadvisor/pull/1281
@@ -18,60 +16,50 @@ Add release notes to [CHANGELOG.md](../../CHANGELOG.md)
1816
Skip this step for patch releases.
1917

2018
```
19+
# Example version
20+
VERSION=v0.23
21+
PATCH_VERSION=$VERSION.0
2122
# Sync to HEAD, or the commit to branch at
22-
$ git fetch upstream && git checkout upstream/master
23+
git fetch upstream && git checkout upstream/master
2324
# Create the branch
24-
$ git branch release-v0.XX
25+
git branch release-$VERSION
2526
# Push it to upstream
26-
$ git push [email protected]:google/cadvisor.git release-v0.XX
27+
git push [email protected]:google/cadvisor.git release-$VERSION
2728
```
2829

29-
### 2.b Tag the release
30-
31-
For a release of minor version XX, patch version YY:
30+
### 2.b Tag the release (for all releases)
3231

3332
```
33+
# Example patch version
34+
VERSION=v0.23
35+
PATCH_VERSION=$VERSION.0
3436
# Checkout the release branch
35-
$ git fetch upstream && git checkout upstream/release-v0.XX
37+
git fetch upstream && git checkout upstream/release-$VERSION
3638
# Tag the release commit. If you aren't signing, ommit the -s
37-
$ git tag -s -a v0.XX.YY
39+
git tag -s -a $PATCH_VERSION
3840
# Push it to upstream
39-
$ git push [email protected]:google/cadvisor.git v0.XX.YY
41+
git push [email protected]:google/cadvisor.git $PATCH_VERSION
4042
```
4143

42-
## 3. Build release binary
44+
## 3. Build release artifacts
4345

4446
Command: `make release`
4547

4648
- Make sure your git client is synced to the release cut point
49+
- Use the same go version as kubernetes: [dependencies.yaml](https://github.com/kubernetes/kubernetes/blob/master/build/dependencies.yaml#L101)
50+
- Tip: use https://github.com/moovweb/gvm to manage multiple go versions.
4751
- Try to build it from the release branch, since we include that in the binary version
4852
- Verify the ldflags output, in particular check the Version, BuildUser, and GoVersion are expected
4953

5054
Once the build is complete, check the VERSION and note the sha256 hash.
5155

5256
## 4. Push the Docker images
5357

54-
Docker Hub:
55-
```
56-
$ docker login
57-
Username: ****
58-
Password: ****
59-
$ docker push google/cadvisor:$VERSION
60-
$ docker logout # Good practice with shared account
61-
```
62-
63-
Google Container Registry:
58+
`make release` should output a command to push the image. Alternatively, run:
6459

6560
```
66-
$ gcloud auth login <account>
67-
...
68-
Go to the following link in your browser:
69-
70-
https://accounts.google.com/o/oauth2/auth?<redacted>
71-
72-
Enter verification code: ****
73-
$ gcloud docker push gcr.io/cadvisor/cadvisor:$VERSION
74-
$ gcloud auth revoke # Log out of shared account
61+
$ PATCH_VERSION=v0.23.0
62+
$ docker push gcr.io/cadvisor/cadvisor:$PATCH_VERSION
7563
```
7664

7765
## 5. Cut the release
@@ -81,14 +69,14 @@ Go to https://github.com/google/cadvisor/releases and click "Draft a new release
8169
- "Tag version" and "Release title" should be preceded by 'v' and then the version. Select the tag pushed in step 2.b
8270
- Copy an old release as a template (e.g. github.com/google/cadvisor/releases/tag/v0.23.1)
8371
- Body should start with release notes (from CHANGELOG.md)
84-
- Next is the Docker image: `google/cadvisor:$VERSION`
72+
- Next is the Docker image: `gcr.io/cadvisor/cadvisor:$VERSION`
8573
- Next are the binary hashes (from step 3)
8674
- Upload the binary build in step 3
87-
- If this is an alpha or beta release, mark the release as a "pre-release"
75+
- If this is a minor version release, mark the release as a "pre-release"
8876
- Click publish when done
8977

9078
## 6. Finalize the release
9179

92-
~~Once you are satisfied with the release quality (consider waiting a week for bug reports to come in), it is time to promote the release to *latest*~~
80+
~~Once you are satisfied with the release quality (generally we wait until the next minor release), it is time to remove the "pre-release" tag~~
9381

9482
cAdvisor is no longer pushed with the :latest tag. This is to ensure tagged images are immutable.

0 commit comments

Comments
 (0)