-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathcloudbuild-dev.yaml
55 lines (54 loc) · 1.58 KB
/
cloudbuild-dev.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
46
47
48
49
50
51
52
53
54
steps:
### Build
- id: 'install'
name: nikolaik/python-nodejs:python3.6-nodejs10
entrypoint: npm
args: ['install']
- id: 'create pem'
name: 'vishnunair/docker-mkcert'
entrypoint: 'bash'
args:
- '-c'
- |
mkcert "*.msaez.io"
- id: 'source build'
name: nikolaik/python-nodejs:python3.6-nodejs10
entrypoint: npm
args: ['run','build']
- id: 'docker build'
name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args:
- '-c'
- |
echo '$COMMIT_SHA =' $COMMIT_SHA
docker build -t gcr.io/$PROJECT_ID/eventstorming-ui-dev:$COMMIT_SHA .
### Publish
- id: 'publish'
name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args:
- '-c'
- |
docker push gcr.io/$PROJECT_ID/eventstorming-ui-dev:$COMMIT_SHA
- id: 'deploy'
name: 'gcr.io/cloud-builders/gcloud'
entrypoint: 'bash'
args:
- '-c'
- |
PROJECT=$$(gcloud config get-value core/project)
gcloud container clusters get-credentials "$${CLOUDSDK_CONTAINER_CLUSTER}" \
--project eventstorming-tool \
--zone "$${CLOUDSDK_COMPUTE_ZONE}"
cat <<EOF | kubectl set image deploy/msaschool-labs-dev msaschool-labs-dev=gcr.io/$PROJECT_ID/eventstorming-ui-dev:$COMMIT_SHA
EOF
images:
- gcr.io/eventstorming-tool/eventstorming-ui-dev:$COMMIT_SHA
timeout: 3600s
options:
machineType: 'E2_HIGHCPU_8'
env:
# # location/name of GKE cluster (used by all kubectl commands)
- CLOUDSDK_COMPUTE_ZONE=asia-northeast1-a
- CLOUDSDK_CONTAINER_CLUSTER=cluster-4