-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcloudbuild.yaml
More file actions
54 lines (52 loc) · 1.6 KB
/
cloudbuild.yaml
File metadata and controls
54 lines (52 loc) · 1.6 KB
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
52
53
54
steps:
- name: gcr.io/cloud-builders/npm
id: jest-test
script: |
#!/bin/bash
set -euo pipefail
npm install -g pnpm
pnpm install
pnpm run jest-test
timeout: 600s
allowExitCodes: [0, 1]
- name: gcr.io/cloud-builders/gcloud
id: analytics-upload
script: |
#!/bin/bash
set -euo pipefail
./get-trunk-cli
./trunk-analytics-cli upload \
--junit-paths "**/junitresults-*.xml" \
--org-url-slug "trunk" \
--token "${TRUNK_API_TOKEN}"
waitFor:
- jest-test
timeout: 300s
env:
# Google Cloud Build default substitution variables
- "PROJECT_ID=${PROJECT_ID}" # required
- "BUILD_ID=${BUILD_ID}" # required
- "PROJECT_NUMBER=${PROJECT_NUMBER}"
- "LOCATION=${LOCATION}"
- "TRIGGER_NAME=${TRIGGER_NAME}" # required
- "COMMIT_SHA=${COMMIT_SHA}"
- "REVISION_ID=${REVISION_ID}"
- "SHORT_SHA=${SHORT_SHA}"
- "REPO_NAME=${REPO_NAME}"
- "REPO_FULL_NAME=${REPO_FULL_NAME}"
- "BRANCH_NAME=${BRANCH_NAME}" # required
- "TAG_NAME=${TAG_NAME}"
- "REF_NAME=${REF_NAME}"
# Google Cloud Build triggered by GitHub PR substitution variables
- "_HEAD_BRANCH=${_HEAD_BRANCH}" # required
- "_BASE_BRANCH=${_BASE_BRANCH}"
- "_HEAD_REPO_URL=${_HEAD_REPO_URL}"
- "_PR_NUMBER=${_PR_NUMBER}" # required
secretEnv: ['TRUNK_API_TOKEN']
options:
logging: CLOUD_LOGGING_ONLY
timeout: 1200s
availableSecrets:
secretManager:
- versionName: projects/${PROJECT_ID}/secrets/prod-trunk-org-token/versions/latest
env: TRUNK_API_TOKEN