Skip to content

Commit 847bc54

Browse files
authored
Add documentation about releases (GoogleCloudPlatform#606)
1 parent 599dac0 commit 847bc54

File tree

1 file changed

+60
-12
lines changed

1 file changed

+60
-12
lines changed

Diff for: hack/README.md

+60-12
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,66 @@
11
## `hack/`
22

3-
This directory provides scripts for building and pushing Docker images, and tagging new demo
4-
releases.
3+
This directory contains the scripts for creating a new `microservices-demo` release.
54

6-
### env variables
5+
### Create a New Release
76

8-
- `TAG` - git release tag / Docker tag.
9-
- `REPO_PREFIX` - Docker repo prefix to push images. Format: `$user/$project`. Resulting images will be of the
10-
format `$user/$project/$svcname:$tag` (where `svcname` = `adservice`, `cartservice`,
11-
etc.)
7+
#### 1. Decide on the next release version number using [semantic versioning](https://semver.org/).
8+
- Look at the [commits since the previous release](https://github.com/GoogleCloudPlatform/microservices-demo/commits/master).
129

13-
### scripts
10+
#### 2. Open a new terminal.
1411

15-
1. `./make-docker-images.sh`: builds and pushes images to the specified Docker repository.
16-
2. `./make-release-artifacts.sh`: generates a combined YAML file with image $TAG at:
17-
`./release/kubernetes-manifests/demo.yaml`.
18-
3. `./make-release.sh`: runs scripts 1 and 2, then runs `git tag` / pushes updated manifests to master.
12+
#### 3. Make sure you have `gsed` installed. If not, `brew install gnu-sed`.
13+
14+
#### 4. Set the following environment variables:
15+
16+
- `TAG` - This is the new version (e.g., `v0.3.5`).
17+
- `REPO_PREFIX` - This is the Docker repository.
18+
##### Example:
19+
```
20+
export TAG=v0.3.5
21+
export REPO_PREFIX=gcr.io/google-samples/microservices-demo
22+
```
23+
24+
#### 5. Run `./hack/make-release.sh`.
25+
26+
- Make sure you run `./hack/make-release.sh` from this project's root folder — **not** from inside the `hack/` folder.
27+
- This script:
28+
1. uses `make-docker-images.sh` to build and push a Docker image for each microservice to the previously specified repository.
29+
1. uses `make-release-artifacts.sh` to regenerates (and update the image $TAGS) YAML file at `./release/kubernetes-manifests.yaml`.
30+
1. runs `git tag` and pushes a new branch (e.g., `release/v0.3.5`) with the changes to `release/kubernetes-manifests.yaml`.
31+
32+
#### 6. Make sure the new Docker images were created and pushed.
33+
34+
- Go through [our Container Registry repository](https://pantheon.corp.google.com/gcr/images/google-samples/global/microservices-demo?project=google-samples).
35+
- Make sure a Docker image was created for each microservice (with the new version tag).
36+
37+
38+
#### 8. [Draft a new release on GitHub](https://github.com/GoogleCloudPlatform/microservices-demo/releases).
39+
40+
- Summarize the [commits since the previous release](https://github.com/GoogleCloudPlatform/microservices-demo/commits/master).
41+
- See previous releases for inspiration on release notes.
42+
43+
#### 7. Create a new pull-request.
44+
45+
- When you ran `make-release.sh`, it created a new branch (e.g., `release/v0.3.5`).
46+
- Include the new release draft in the pull-request description for reviewers to see.
47+
48+
#### 8. Once your pull-request is approved, merge it.
49+
50+
#### 9. Connect to our [onlineboutique-master GKE cluster](https://pantheon.corp.google.com/kubernetes/clusters/details/us-central1-c/online-boutique-master/details?project=onlineboutique-ci)
51+
52+
- To do this, you can use:
53+
```
54+
gcloud container clusters get-credentials online-boutique-master \
55+
--zone us-central1-c --project onlineboutique-ci
56+
```
57+
58+
#### 10. Deploy `release/kubernetes-manifests.yaml` to our [onlineboutique-master GKE cluster](https://pantheon.corp.google.com/kubernetes/clusters/details/us-central1-c/online-boutique-master/details?project=onlineboutique-ci).
59+
60+
```
61+
kubectl apply -f ./release/kubernetes-manifests.yaml
62+
```
63+
64+
#### 11. Make sure [onlineboutique.dev](https://onlineboutique.dev) works.
65+
66+
#### 12. [Publish your draft release on GitHub](https://github.com/GoogleCloudPlatform/microservices-demo/releases)!

0 commit comments

Comments
 (0)