-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
38 lines (36 loc) · 1.17 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
substitutions:
_REGION: us-central1
_REPOSITORY: cnat
_CD_PIPELINE: cnat-api-gateway-cd
steps:
- name: "gcr.io/k8s-skaffold/skaffold"
entrypoint: "sh"
args:
- -xe
- -c
- |
# Build and push images
skaffold build --file-output=/workspace/artifacts.json \
--default-repo=${_REGION}-docker.pkg.dev/$PROJECT_ID/${_REPOSITORY} \
--push=true
- name: "google/cloud-sdk:latest"
entrypoint: "sh"
args:
- -xe
- -c
- |
gcloud config set deploy/region ${_REGION}
sed -i s/PROJECT_ID/$PROJECT_ID/g deploy/*
gcloud deploy apply --file deploy/pipeline.yaml
gcloud deploy apply --file deploy/staging.yaml
gcloud deploy apply --file deploy/prod.yaml
gcloud deploy releases create rel-${SHORT_SHA} \
--delivery-pipeline ${_CD_PIPELINE} \
--description "$(git log -1 --pretty='%s')" \
--build-artifacts /workspace/artifacts.json
artifacts:
objects:
location: "gs://$PROJECT_ID-gceme-artifacts/"
paths:
- "/workspace/artifacts.json"
timeout: 3600s