-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathcloudbuild.yaml
30 lines (25 loc) · 927 Bytes
/
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
steps:
# Install dependencies.
- name: 'gcr.io/cloud-builders/npm'
args: ['install']
# Unit test.
- name: 'gcr.io/cloud-builders/npm'
args: ['run', 'test:unit']
# Build the new docker image.
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/gcb-docker-compose:latest', '.']
# Run the app and dependencies in the background using docker-compose.
# Warning: this won't be cleaned up, which might be an issue if you run it
# with the local builder.
- name: 'docker/compose:1.15.0'
args: ['up', '-d']
env:
- 'PROJECT_ID=$PROJECT_ID'
# Run the integration tests against the running docker-compose stack.
- name: 'gcr.io/cloud-builders/npm'
args: ['run', 'test:integration']
env:
- 'HOST=counter' # running container, container_name defined in the docker-compose.yml
- 'PORT=50051'
# Push the new image to the registry.
images: ['gcr.io/$PROJECT_ID/gcb-docker-compose:latest']