-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
43 lines (43 loc) · 1.4 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
steps:
# Load images for cachig
- name: 'gcr.io/cloud-builders/docker'
args: [ 'pull', 'eu.gcr.io/$PROJECT_ID/team-pomodoro:latest' ]
- name: 'gcr.io/cloud-builders/docker'
args: [ 'pull', 'eu.gcr.io/$PROJECT_ID/team-pomodoro-test-runner:latest' ]
# Build test-runner image
- name: 'gcr.io/cloud-builders/docker'
args: [
'build',
'--build-arg', 'MIX_ENV=test',
'--cache-from', 'eu.gcr.io/$PROJECT_ID/team-pomodoro-test-runner:latest',
'-t', 'eu.gcr.io/$PROJECT_ID/team-pomodoro-test-runner:latest',
'.' ]
# Run Tests with test-runner
- name: 'gcr.io/cloud-builders/docker'
args: [
'run',
'-e', 'MIX_ENV=test',
'eu.gcr.io/$PROJECT_ID/team-pomodoro-test-runner:latest',
'mix', 'test' ]
# Run Tests with test-runner
- name: 'gcr.io/cloud-builders/docker'
args: [
'run',
'-e', 'MIX_ENV=test',
'eu.gcr.io/$PROJECT_ID/team-pomodoro-test-runner:latest',
'mix', 'credo' ]
# Build production image
- name: 'gcr.io/cloud-builders/docker'
args: [
'build',
'--cache-from', 'eu.gcr.io/$PROJECT_ID/team-pomodoro:latest',
'-t', 'eu.gcr.io/$PROJECT_ID/team-pomodoro:latest',
'-t', 'eu.gcr.io/$PROJECT_ID/team-pomodoro:prod',
'.' ]
# publish following images
images:
- 'eu.gcr.io/$PROJECT_ID/team-pomodoro:latest'
- 'eu.gcr.io/$PROJECT_ID/team-pomodoro:prod'
- 'eu.gcr.io/$PROJECT_ID/team-pomodoro-test-runner:latest'
# Timeout 20min (Default 10min)
timeout: 1200s