Skip to content

Commit ec5cea8

Browse files
author
Sam Thorogood
authored
cleanup external task (GoogleChrome#1561)
1 parent 7849495 commit ec5cea8

File tree

4 files changed

+52
-29
lines changed

4 files changed

+52
-29
lines changed

.cloudbuild/cleanup.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
steps:
2-
- name: 'gcr.io/cloud-builders/gcloud'
3-
entrypoint: 'bash'
4-
args: ['-c', './.cloudbuild/cleanup.sh']
2+
- name: 'gcr.io/cloud-builders/gcloud'
3+
entrypoint: 'bash'
4+
args: ['-c', './.cloudbuild/cleanup.sh']

.cloudbuild/deploy.yaml

+28-24
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,36 @@
11
timeout: 2700s # set build timeout to 45 mins
22
steps:
3-
- name: node
4-
entrypoint: npm
5-
args: ['ci']
6-
- name: node
7-
entrypoint: npm
8-
args: ['run', 'cloud-secrets']
9-
env:
10-
- 'PROJECT_ID=$PROJECT_ID'
11-
- name: node
12-
entrypoint: npm
13-
args: ['run', 'production']
14-
- name: node
15-
entrypoint: npm
16-
args: ['run', 'algolia']
17-
- name: 'gcr.io/cloud-builders/gcloud'
18-
entrypoint: 'bash'
19-
args:
20-
- '-c'
21-
- |
22-
# This snippet lets us pass additional args via the Cloud Build console
23-
# in the _EXTRA_GCLOUD_ARGS var.
24-
# nb. We don't have to specify --project; it's part of the environment.
25-
gcloud app deploy ${_EXTRA_GCLOUD_ARGS}
3+
- name: node
4+
entrypoint: npm
5+
args: ['ci']
6+
7+
- name: node
8+
entrypoint: npm
9+
args: ['run', 'cloud-secrets']
10+
11+
- name: node
12+
entrypoint: npm
13+
args: ['run', 'production']
14+
15+
- name: node
16+
entrypoint: npm
17+
args: ['run', 'algolia']
18+
19+
- name: 'gcr.io/cloud-builders/gcloud'
20+
entrypoint: 'bash'
21+
args:
22+
- '-c'
23+
- |
24+
# This snippet lets us pass additional args via the Cloud Build console
25+
# in the _EXTRA_GCLOUD_ARGS var.
26+
# nb. We don't have to specify --project; it's part of the environment.
27+
gcloud app deploy ${_EXTRA_GCLOUD_ARGS}
28+
2629
substitutions:
2730
_EXTRA_GCLOUD_ARGS: # default empty
2831

2932
options:
3033
machineType: 'E2_HIGHCPU_8' # yolo
3134
env:
32-
- 'NODE_OPTIONS=--max_old_space_size=4096 --unhandled-rejections=strict'
35+
- 'NODE_OPTIONS=--unhandled-rejections=strict'
36+
- 'PROJECT_ID=$PROJECT_ID'

.cloudbuild/external.yaml

+7-2
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@ steps:
99
entrypoint: npm
1010
args: ['ci']
1111

12+
- name: node:14
13+
id: 'Configure secrets'
14+
entrypoint: npm
15+
args: ['run', 'cloud-secrets']
16+
1217
- name: node:14
1318
id: 'Build external data'
1419
entrypoint: npm
1520
args: ['run', 'build-external']
1621
env:
17-
- 'PROJECT_ID=$PROJECT_ID'
1822
- 'NODE_ENV=production'
1923

2024
- name: node:14
@@ -43,4 +47,5 @@ steps:
4347
4448
options:
4549
env:
46-
- 'NODE_OPTIONS=--max_old_space_size=4096 --unhandled-rejections=strict'
50+
- 'PROJECT_ID=$PROJECT_ID'
51+
- 'NODE_OPTIONS=--unhandled-rejections=strict'

external/README.md

+14
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,17 @@ This folder contains the system that deals with external data for developer.chro
77
- otherwise, run `npm run sync-external` to retrieve the last known good files stored in Cloud Storage
88

99
- running `npm run dev` will automatically pull external data
10+
11+
## Changes
12+
13+
If you make changes to the build script(s), you can manually kick off a Cloud Build task to confirm that the output builds and to write it to storage for other users.
14+
15+
```bash
16+
$ gcloud builds submit --config .cloudbuild/external.yaml .
17+
```
18+
19+
You can confirm the contents of the bucket by:
20+
21+
```bash
22+
$ gsutil ls -l gs://external-dcc-data
23+
```

0 commit comments

Comments
 (0)