-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild-prod.yaml
33 lines (32 loc) · 1.06 KB
/
cloudbuild-prod.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
steps:
# Build the container image
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/hci-api:$COMMIT_SHA', '.']
# Push the container image to Container Registry
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/hci-api:$COMMIT_SHA']
# Kustomize: set the image in the kustomization.yaml file
- name: 'gcr.io/cloud-builders/gke-deploy'
dir: 'k8s/prod'
entrypoint: 'kustomize'
args:
- 'edit'
- 'set'
- 'image'
- 'gcr.io/project-id/hci-api=gcr.io/$PROJECT_ID/hci-api:$COMMIT_SHA'
# Kustomize: apply the kustomization.yaml file
- name: 'gcr.io/cloud-builders/gke-deploy'
dir: 'k8s/prod'
entrypoint: 'kustomize'
args: ['build', '.', '-o', 'prod.yaml']
# Deploy the application to the GKE cluster
- name: 'gcr.io/cloud-builders/gke-deploy'
dir: 'k8s/prod'
args:
- 'run'
- '--filename=prod.yaml'
- '--location=us-central1'
- '--cluster=datario'
- '--project=datario'
images:
- 'gcr.io/$PROJECT_ID/hci-api:$COMMIT_SHA'