-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathgooglecloudbuild-dev.yaml
43 lines (36 loc) · 1.15 KB
/
googlecloudbuild-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
steps:
- id: 'Login to dockerhub'
name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args: ['-c', 'docker login --username=$_DOCKERHUB_USERNAME --password=$$DOCKERHUB_TOKEN']
secretEnv: ['DOCKERHUB_TOKEN']
- id: 'Build docker image'
name: 'gcr.io/cloud-builders/docker'
args:
- build
- '-t'
- '$_DOCKERHUB_ORGANISATION/$_DOCKERHUB_REPOSITORY:$SHORT_SHA'
- '.'
- id: 'Show docker images'
name: 'gcr.io/cloud-builders/docker'
args: ['images']
- id: 'Push docker image'
name: 'gcr.io/cloud-builders/docker'
args:
- push
- '$_DOCKERHUB_ORGANISATION/$_DOCKERHUB_REPOSITORY:$SHORT_SHA'
- name: "gcr.io/cloud-builders/gke-deploy"
args:
- run
- --filename=deployment/dev/
- --image=$_DOCKERHUB_ORGANISATION/$_DOCKERHUB_REPOSITORY:$SHORT_SHA
- --location=europe-west1-d
- --cluster=demo-cluster
substitutions:
_DOCKERHUB_ORGANISATION: "kahootali"
_DOCKERHUB_USERNAME: "kahootali"
_DOCKERHUB_REPOSITORY: "golang-sample-app"
availableSecrets:
secretManager:
- versionName: projects/$PROJECT_ID/secrets/DOCKERHUB_TOKEN/versions/2
env: 'DOCKERHUB_TOKEN'