-
Notifications
You must be signed in to change notification settings - Fork 210
/
Copy pathcloudbuild.yaml
42 lines (42 loc) · 1.05 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
40
41
42
steps:
- id: 'build'
name: 'gcr.io/cloud-builders/mvn'
args: [
'clean',
'package',
'-Dmaven.test.skip=true'
]
### 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/$_PROJECT_NAME:$COMMIT_SHA .
### Test
### Publish
- id: 'publish'
name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args:
- '-c'
- |
docker push gcr.io/$PROJECT_ID/$_PROJECT_NAME:$COMMIT_SHA
### deploy
- id: 'deploy'
name: "gcr.io/cloud-builders/gke-deploy"
args:
- run
- --filename=kubernetes/deployment.yaml
- --image=gcr.io/$PROJECT_ID/$_PROJECT_NAME:$COMMIT_SHA
- --location=asia-northeast1-a
- --cluster=cluster-1
substitutions:
_PROJECT_NAME: gateway
options:
env:
# # location/name of GKE cluster (used by all kubectl commands)
- CLOUDSDK_COMPUTE_ZONE=asia-northeast1-a
- CLOUDSDK_CONTAINER_CLUSTER=cluster-1