-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathcloudbuild.yaml
42 lines (34 loc) · 1.54 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: 'docker-run'
name: gcr.io/cloud-builders/docker
args: ['run', '-d', '-p=5432:5432', '--name=roadkill-postgres', '--network=cloudbuild', 'postgres']
- id: 'sleep'
name: jwilder/dockerize:0.6.1
args: ['dockerize', '-timeout=60s', '-wait=tcp://roadkill-postgres:5432']
- id: 'psql-create-db'
name: postgres
args: ['psql', '--host=roadkill-postgres', '--user=postgres', '--command', 'CREATE DATABASE roadkilltests;']
waitFor: ['sleep']
- id: 'psql-create-user'
name: postgres
args: ['psql', '--host=roadkill-postgres', '--user=postgres', '--command', 'CREATE USER roadkill WITH PASSWORD ''roadkill'';']
waitFor: ['psql-create-db']
- id: 'psql-assign-role'
name: postgres
args: ['psql', '--host=roadkill-postgres', '--user=postgres', '--command', 'ALTER USER roadkill WITH SUPERUSER;']
waitFor: ['psql-create-user']
- id: 'dotnet-build'
name: mcr.microsoft.com/dotnet/core/sdk:5.0
args: ['dotnet', 'build', '-c', 'Release']
- id: 'dotnet-test-unit'
name: mcr.microsoft.com/dotnet/core/sdk:5.0
args: ['dotnet', 'test', '-c', 'Release', '--logger:"console;verbosity=detailed"']
dir: 'src/Roadkill.Tests.Unit'
waitFor: ['dotnet-build']
- id: 'dotnet-test-integration'
name: mcr.microsoft.com/dotnet/core/sdk:5.0
args: ['dotnet', 'test', '-c', 'Release', '--logger:"console;verbosity=detailed"']
dir: 'src/Roadkill.Tests.Integration'
waitFor: ['dotnet-test-unit']
- name: gcr.io/cloud-builders/docker
args: ['rm', '--force', 'roadkill-postgres']