-
Notifications
You must be signed in to change notification settings - Fork 5
/
cloudbuild.yaml
52 lines (43 loc) · 1.05 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
steps:
- id: npm-install
name: node:18
secretEnv: ['NPM_TOKEN']
entrypoint: npm
args: ['i', '--quiet', '--package-lock-only']
- id: npm-audit
name: 'gcr.io/$PROJECT_ID/cloudbuilders/audit-filter:0.5.0'
secretEnv: ['NPM_TOKEN']
entrypoint: "/bin/bash"
args:
- -c
- npm audit --production --json | audit-filter
waitFor:
- 'npm-install'
- id: npm-ci
name: node:18
secretEnv: ['NPM_TOKEN']
entrypoint: npm
args: ['ci', '--quiet']
- id: test-unit
name: node:18
secretEnv: ['NPM_TOKEN']
entrypoint: npm
args: ['test']
env:
- 'NODE_ENV=test'
- id: npm-publish
name: 'gcr.io/$PROJECT_ID/cloudbuilders/npm:6.13.4'
secretEnv: ['NPM_TOKEN']
env:
- 'TAG_NAME=$TAG_NAME'
- '_PR_NUMBER=$_PR_NUMBER'
timeout: 10m
logsBucket: 'gs://$PROJECT_ID-primary-cloudbuild-logs'
tags:
- 'backend'
- 'npm'
- 'nodejs'
availableSecrets:
secretManager:
- versionName: projects/145393225073/secrets/npm-token-publish/versions/latest
env: NPM_TOKEN