This repository was archived by the owner on Feb 17, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcloudbuild.yaml
More file actions
68 lines (57 loc) · 2.35 KB
/
cloudbuild.yaml
File metadata and controls
68 lines (57 loc) · 2.35 KB
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
steps:
- id: "Build images"
name: "gcr.io/$PROJECT_ID/kubails-builder"
args: ["kubails", "service", "images", "build", "--branch", "${BRANCH_NAME}", "--commit", "${SHORT_SHA}"]
- id: "Run CI on all services"
name: "gcr.io/$PROJECT_ID/kubails-builder"
args: ["kubails", "service", "ci", "--tag", "${BRANCH_NAME}"]
- id: "Push built images"
name: "gcr.io/$PROJECT_ID/kubails-builder"
args: ["kubails", "service", "images", "push", "--branch", "${BRANCH_NAME}", "--commit", "${SHORT_SHA}"]
- id: "Get project service account key to access Terraform state"
name: "gcr.io/$PROJECT_ID/kubails-builder"
args: ["kubails", "infra", "authenticate"]
- id: "Generate Kubernetes service manifests"
name: "gcr.io/$PROJECT_ID/kubails-builder"
entrypoint: "bash"
args:
- -c
- |
kubails cluster manifests generate --tag ${SHORT_SHA} --namespace ${BRANCH_NAME}
bash ./scripts/cloudbuild_cleanup.sh $?
- id: "Deploy generated Kubernetes manifests"
name: "gcr.io/$PROJECT_ID/kubails-builder"
entrypoint: "bash"
args:
- -c
- |
kubails cluster authenticate
kubails cluster manifests deploy --namespace ${BRANCH_NAME}
bash ./scripts/cloudbuild_cleanup.sh $?
- id: "Decrypt and deploy secrets files"
name: "gcr.io/$PROJECT_ID/kubails-builder"
entrypoint: "bash"
args:
- -c
- |
kubails cluster authenticate
kubails cluster secrets deploy --namespace ${BRANCH_NAME}
bash ./scripts/cloudbuild_cleanup.sh $?
- id: "Cleanup unused Kubernetes namespaces"
name: "gcr.io/$PROJECT_ID/kubails-builder"
entrypoint: "bash"
args:
- -c
- |
kubails cluster authenticate
kubails cluster cleanup-namespaces
bash ./scripts/cloudbuild_cleanup.sh $?
- id: "Cleanup service account key"
name: "gcr.io/$PROJECT_ID/kubails-builder"
args: ["kubails", "infra", "unauthenticate"]
- id: "Send slack success notification"
name: "gcr.io/$PROJECT_ID/kubails-builder"
args: ["kubails", "notify", "slack", "success", "${_SLACK_WEBHOOK}", "--namespace", "${BRANCH_NAME}", "--commit", "${SHORT_SHA}"]
substitutions:
_SLACK_WEBHOOK: ""
timeout: 1800s