Skip to content

Commit 024df61

Browse files
committed
Docs: explain why we push deployer twice
Signed-off-by: Maël Valais <[email protected]>
1 parent 7debbd8 commit 024df61

File tree

2 files changed

+41
-12
lines changed

2 files changed

+41
-12
lines changed

cloudbuild.yaml

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ timeout: 1800s # 30m
22
substitutions:
33
_CLUSTER_NAME: cluster-1
44
_CLUSTER_LOCATION: europe-west2-b
5-
_APP_VERSION: 1.1.0-gcm.1
5+
# The deployer version must always be a minor version at any time since
6+
# the Marketplace UI will only accept minor tags for the deployer.
7+
_DEPLOYER_VERSION: "1.1"
8+
# The _APP_VERSION must be equal to the value set on the publishedVersion
9+
# field in schema.yaml.
10+
_APP_VERSION: "1.1.0-gcm.1"
611
_SOLUTION_NAME: jetstack-secure-for-cert-manager
712
steps:
813
- id: pull-ubbagent
@@ -58,7 +63,8 @@ steps:
5863
waitFor:
5964
- "-"
6065

61-
- id: build-deployer
66+
# We push a deployer:1.1.0-gcm.1 for our debugging purposes.
67+
- id: build-deployer-using-app-version
6268
name: gcr.io/cloud-builders/docker
6369
args:
6470
- build
@@ -67,13 +73,32 @@ steps:
6773
- "."
6874
waitFor: ["set-data-test-schema-default-values"]
6975

70-
- id: push-deployer
76+
- id: push-deployer-using-app-version
7177
name: gcr.io/cloud-builders/docker
7278
args:
7379
- push
7480
- gcr.io/$PROJECT_ID/${_SOLUTION_NAME}/deployer:${_APP_VERSION}
7581
waitFor:
76-
- build-deployer
82+
- build-deployer-using-app-version
83+
84+
# The tag deployer:1.1 (for example) is the actual "important" image
85+
# since it is the one that will be used in the Marketplace UI.
86+
- id: tag-deployer-using-minor-version
87+
name: gcr.io/cloud-builders/docker
88+
args:
89+
- tag
90+
- gcr.io/$PROJECT_ID/${_SOLUTION_NAME}/deployer:${_APP_VERSION}
91+
- gcr.io/$PROJECT_ID/${_SOLUTION_NAME}/deployer:${_DEPLOYER_VERSION}
92+
waitFor:
93+
- build-deployer-using-app-version
94+
95+
- id: push-deployer-using-minor-version
96+
name: gcr.io/cloud-builders/docker
97+
args:
98+
- push
99+
- gcr.io/$PROJECT_ID/${_SOLUTION_NAME}/deployer:${_APP_VERSION}
100+
waitFor:
101+
- tag-deployer-using-minor-version
77102

78103
- id: gcloud-credentials
79104
name: gcr.io/cloud-builders/gcloud

docs/TESTING-DEPLOYER.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,19 @@ the image embeds:
2020
- The `helm` tool,
2121
- The Helm charts for cert-manager, google-cas-issuer and preflight.
2222
23-
The deployer image looks like this:
23+
There are two deployer tags:
2424
2525
```sh
26+
# The main moving tag required by the Marketplace UI:
2627
marketplace.gcr.io/jetstack-public/jetstack-secure-for-cert-manager/deployer:1.1
28+
29+
# A static tag for debugging purposes:
30+
marketplace.gcr.io/jetstack-public/jetstack-secure-for-cert-manager/deployer:1.1.0-gcm.1
2731
```
2832
29-
We provide one single tag for the deployer image. That is due to the fact
30-
that the Marketplace UI only works with minor versions (e.g., `1.1`). If we
31-
were to push other tags (e.g., `1.1.0` or `1.1.0-gcm.1`), they would not be
32-
used anyways:
33+
The minor tag `1.1` (for example) is the tag that the Marketplace UI needs.
34+
The other tags (e.g., `1.1.0` or `1.1.0-gcm.1`) cannot be used for the
35+
Marketplace UI:
3336

3437
> A version should correspond to a minor version (e.g. `1.0`) according to
3538
> semantic versioning (not a patch version, such as `1.1.0`). Update the
@@ -41,9 +44,9 @@ In the below screenshot, we see that both the deployer tags `1.1.0` and
4144

4245
<img src="https://user-images.githubusercontent.com/2195781/110091031-491bed00-7d98-11eb-8522-ddc91913d010.png" width="500" alt="Only the minor version 1.1 should be pushed, not 1.1.0 or 1.1.0-gcm.1. This screenshot is stored in this issue: https://github.com/jetstack/jetstack-secure-gcm/issues/21">
4346

44-
Important: although we only push the minor tag for the deployer image, we
45-
still push "full" tags for all the other images. For example, let us
46-
imagine that `deployer:1.1` was created with this `schema.yaml`:
47+
Note that we only push full tags (e.g., `1.1.0-gcm.1`) for all the other
48+
images. For example, let us imagine that `deployer:1.1` was created with
49+
this `schema.yaml`:
4750

4851
```yaml
4952
# schema.yaml
@@ -82,6 +85,7 @@ As a recap about image tags, here is what the tags look like now, taking
8285
```sh
8386
# The deployer image is built and pushed in cloudbuild.yaml:
8487
gcr.io/jetstack-public/jetstack-secure-for-cert-manager/deployer:1.1
88+
gcr.io/jetstack-public/jetstack-secure-for-cert-manager/deployer:1.1.0-gcm.1
8589
8690
# These images are manually pushed (see below command):
8791
gcr.io/jetstack-public/jetstack-secure-for-cert-manager:1.1.0-gcm.1 # this is cert-manager-controller

0 commit comments

Comments
 (0)