-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
39 lines (39 loc) · 1.1 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
id: cds-emulator
args: ['run', '-d', '--network=cloudbuild', '--name=cds-emulator', 'google/cloud-sdk:248.0.0', 'gcloud', 'beta', 'emulators', 'datastore', 'start', '--host-port=0.0.0.0:8081']
- name: jwilder/dockerize:0.6.1
args: ['dockerize', '-timeout=60s', '-wait=tcp://cds-emulator:8081']
- name: 'golang:1.13-stretch'
id: go-test
entrypoint: 'go'
args: ['test', '-v', './...']
env:
- 'GO111MODULE=on'
- 'DATASTORE_EMULATOR_HOST=cds-emulator:8081'
- 'GOOGLE_CLOUD_PROJECT=unittest'
waitFor: ['cds-emulator']
# angular build
- name: node:12.13
id: npm-ci
entrypoint: 'npm'
args: ['ci']
dir: 'frontend'
waitFor: ['-']
- name: node:12.13
id: npm-run
entrypoint: 'npm'
args: ['run', 'build:prod']
dir: 'frontend'
waitFor: ['npm-ci']
# deploy
- name: 'gcr.io/cloud-builders/gcloud'
args:
- 'app'
- 'deploy'
waitFor:
- 'go-test'
- 'npm-run'
# for cloud-build-local
- name: gcr.io/cloud-builders/docker
args: ['rm', '--force', 'cds-emulator']