forked from controlplaneio/kubesec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
39 lines (38 loc) · 1.2 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
steps:
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/kubesec:${SHORT_SHA}', '.']
- name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args:
- '-c'
- |
set -euxo pipefail
docker build -t gcr.io/$PROJECT_ID/kubesec:${SHORT_SHA} .
if [[ "${BRANCH_NAME}" == "master" ]]; then
docker push gcr.io/${PROJECT_ID}/kubesec:${SHORT_SHA}
fi
- name: 'gcr.io/cloud-builders/gcloud'
entrypoint: 'bash'
args:
- '-c'
- |
set -euxo pipefail
if [[ "${BRANCH_NAME}" == "master" ]]; then
gcloud beta run deploy kubesec \
--image gcr.io/${PROJECT_ID}/kubesec:${SHORT_SHA} \
--platform managed \
--region us-central1
fi
# TODO(ajm): `make test-remote` on branch
- name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args:
- '-c'
- |
set -euxo pipefail
JQ_VER="1.6"
if [[ "${BRANCH_NAME}" == "master" ]]; then
curl -Lo /usr/local/bin/jq "https://github.com/stedolan/jq/releases/download/jq-$${JQ_VER}/jq-linux64"
chmod +x /usr/local/bin/jq
make test-remote
fi