-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcloudbuild.yaml
45 lines (40 loc) · 1.37 KB
/
cloudbuild.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
steps:
- id: decipher secret
name: gcr.io/cloud-builders/gcloud
args:
- kms
- decrypt
- "--ciphertext-file=kustomize/overlays/$_KUSTOMIZE_ENV/application.secrets.encrypted"
- "--plaintext-file=kustomize/overlays/$_KUSTOMIZE_ENV/application.secrets"
- "--location=$_GKE_LOCATION"
- "--keyring=jeremy-key-ring"
- "--key=hello-world-k8s"
- id: Build
name: gcr.io/cloud-builders/docker
entrypoint: bash
args: ["-c", "docker build -t asia.gcr.io/effective-might-323902/hello-world-k8s-jeremy . -f Dockerfile"]
- id: Push
name: gcr.io/cloud-builders/docker
args: ["push", "asia.gcr.io/effective-might-323902/hello-world-k8s-jeremy"]
- id: Generate manifest
name: gcr.io/cloud-builders/gke-deploy
entrypoint: kustomize
args:
- build
- kustomize/overlays/$_KUSTOMIZE_ENV
- -o
- /workspace/kustomize-output.yaml
env:
- CLOUDSDK_COMPUTE_ZONE=$_GKE_LOCATION
- CLOUDSDK_CONTAINER_CLUSTER=$_GKE_CLUSTER
- id: Apply deploy
name: gcr.io/cloud-builders/gke-deploy
args: ["apply", "--filename=kustomize-output.yaml", "--cluster=jeremy-cluster", "--location=asia-southeast1", "--namespace=jeremy"]
env:
- CLOUDSDK_COMPUTE_ZONE=$_GKE_LOCATION
- CLOUDSDK_CONTAINER_CLUSTER=$_GKE_CLUSTER
options:
substitutionOption: ALLOW_LOOSE
tags:
- devops-workshop
- hello-world-k8s