-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudbuild.yaml
77 lines (59 loc) · 2.29 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
substitutions:
_PRIVATE_IMAGE_NAME: eu.gcr.io/devar-p/mifi-backend # default value
_PUBLIC_IMAGE_NAME: mseravalli/mifi-backend # default value
_BUILDER_IMAGE: eu.gcr.io/devar-p/mifi-backend-builder # default value
secrets:
- kmsKeyName: projects/devar-p/locations/europe-west4/keyRings/mifi/cryptoKeys/docker-hub-key
secretEnv:
PASSWORD: CiQAkkk1x1+Xb9Mrb0GetD0rRX6yvjVWQi0o7M8UBYV+uNKV8UQSQgA/Oojspp/3ojM5L/aA1RTezmE7ZFugJ5oyxqIoy3pgA1VgXK8wgj+JqrynkZ6s60Jlibd9SjOXEa3m1+dIU1j7XQ==
steps:
- id: 'clean'
name: '${_BUILDER_IMAGE}'
args: ['bash', 'activator', '--info', 'clean']
- id: 'build'
name: '${_BUILDER_IMAGE}'
args: ['bash', 'activator', '--info', 'compile']
- id: 'setup integration environment'
name: 'docker/compose:1.15.0'
args: ['up', '-d']
- id: 'integration test'
name: '${_BUILDER_IMAGE}'
args: ['bash', 'activator', '--info', 'test']
- id: 'package'
name: '${_BUILDER_IMAGE}'
args: ['bash', 'activator', '--info', 'dist']
- id: 'extract'
name: '${_BUILDER_IMAGE}'
args: ['bash', 'extract-dist.sh']
- id: 'docker-build-latest'
name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', '${_PRIVATE_IMAGE_NAME}:latest', '.']
- id: 'docker-tag-private-version'
name: 'gcr.io/cloud-builders/docker'
args: ['tag', '${_PRIVATE_IMAGE_NAME}:latest', '${_PRIVATE_IMAGE_NAME}:${TAG_NAME}']
- id: 'docker-tag-public-latest'
name: 'gcr.io/cloud-builders/docker'
args: ['tag', '${_PRIVATE_IMAGE_NAME}:latest', '${_PUBLIC_IMAGE_NAME}:latest']
- id: 'docker-tag-public-version'
name: 'gcr.io/cloud-builders/docker'
args: ['tag', '${_PRIVATE_IMAGE_NAME}:latest', '${_PUBLIC_IMAGE_NAME}:${TAG_NAME}']
- id: 'check-password'
name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args: ['-c', 'echo $$PASSWORD']
secretEnv: ['PASSWORD']
- id: 'docker-login-to-docker-hub'
name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args: ['-c', 'docker login --username=mseravalli --password=$$PASSWORD']
secretEnv: ['PASSWORD']
- id: 'docker-push-public-latest'
name: 'gcr.io/cloud-builders/docker'
args: ['push', '${_PUBLIC_IMAGE_NAME}:latest']
- id: 'docker-push-public-version'
name: 'gcr.io/cloud-builders/docker'
args: ['push', '${_PUBLIC_IMAGE_NAME}:${TAG_NAME}']
images: [
'${_PRIVATE_IMAGE_NAME}:latest',
'${_PRIVATE_IMAGE_NAME}:${TAG_NAME}',
]