forked from GoogleCloudPlatform/marketplace-k8s-app-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild-tag-prerelease.yaml
69 lines (56 loc) · 2.68 KB
/
cloudbuild-tag-prerelease.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Used for building tags that are intended as pre-releases.
# This is different from cloudbuilt-tag.yaml in that it does not
# update the "latest" tag in the GCR repos.
substitutions:
_STAGING_PROJECT_ID: null
steps:
- id: &PublishImages Publish Images
name: gcr.io/cloud-builders/docker
waitFor:
- '-'
entrypoint: bash
args:
- -ceux
- |
docker pull gcr.io/$_STAGING_PROJECT_ID/k8s/dev:sha_$COMMIT_SHA
docker tag gcr.io/$_STAGING_PROJECT_ID/k8s/dev:sha_$COMMIT_SHA gcr.io/$PROJECT_ID/k8s/dev:$TAG_NAME
docker pull gcr.io/$_STAGING_PROJECT_ID/k8s/deployer_helm:sha_$COMMIT_SHA
docker tag gcr.io/$_STAGING_PROJECT_ID/k8s/deployer_helm:sha_$COMMIT_SHA gcr.io/$PROJECT_ID/k8s/deployer_helm:$TAG_NAME
docker pull gcr.io/$_STAGING_PROJECT_ID/k8s/deployer_helm/onbuild:sha_$COMMIT_SHA
docker tag gcr.io/$_STAGING_PROJECT_ID/k8s/deployer_helm/onbuild:sha_$COMMIT_SHA gcr.io/$PROJECT_ID/k8s/deployer_helm/onbuild:$TAG_NAME
docker pull gcr.io/$_STAGING_PROJECT_ID/k8s/deployer_helm2:sha_$COMMIT_SHA
docker tag gcr.io/$_STAGING_PROJECT_ID/k8s/deployer_helm2:sha_$COMMIT_SHA gcr.io/$PROJECT_ID/k8s/deployer_helm2:$TAG_NAME
docker pull gcr.io/$_STAGING_PROJECT_ID/k8s/deployer_helm2/onbuild:sha_$COMMIT_SHA
docker tag gcr.io/$_STAGING_PROJECT_ID/k8s/deployer_helm2/onbuild:sha_$COMMIT_SHA gcr.io/$PROJECT_ID/k8s/deployer_helm2/onbuild:$TAG_NAME
docker pull gcr.io/$_STAGING_PROJECT_ID/k8s/deployer_envsubst:sha_$COMMIT_SHA
docker tag gcr.io/$_STAGING_PROJECT_ID/k8s/deployer_envsubst:sha_$COMMIT_SHA gcr.io/$PROJECT_ID/k8s/deployer_envsubst:$TAG_NAME
docker pull gcr.io/$_STAGING_PROJECT_ID/k8s/deployer_envsubst/onbuild:sha_$COMMIT_SHA
docker tag gcr.io/$_STAGING_PROJECT_ID/k8s/deployer_envsubst/onbuild:sha_$COMMIT_SHA gcr.io/$PROJECT_ID/k8s/deployer_envsubst/onbuild:$TAG_NAME
- id: Publish Charts
name: gcr.io/$PROJECT_ID/k8s/dev:$TAG_NAME
waitFor:
- *PublishImages
entrypoint: bash
args:
- -ceux
- |
mkdir charts-tgz/
helm init --client-only
helm package marketplace/charts/marketplace-integration/ \
--version $TAG_NAME \
--destination charts-tgz/
gsutil cp gs://$PROJECT_ID/charts/index.yaml index.yaml
helm repo index --merge index.yaml charts-tgz/
images:
- gcr.io/$PROJECT_ID/k8s/dev:$TAG_NAME
- gcr.io/$PROJECT_ID/k8s/deployer_helm:$TAG_NAME
- gcr.io/$PROJECT_ID/k8s/deployer_helm/onbuild:$TAG_NAME
- gcr.io/$PROJECT_ID/k8s/deployer_helm2:$TAG_NAME
- gcr.io/$PROJECT_ID/k8s/deployer_helm2/onbuild:$TAG_NAME
- gcr.io/$PROJECT_ID/k8s/deployer_envsubst:$TAG_NAME
- gcr.io/$PROJECT_ID/k8s/deployer_envsubst/onbuild:$TAG_NAME
artifacts:
objects:
location: gs://$PROJECT_ID/charts/
paths:
- charts-tgz/*