forked from bcgov/bcregistry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild-pr.yaml
72 lines (72 loc) · 2.46 KB
/
cloudbuild-pr.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
steps:
# install / setup ci
- name: node:16.14.2
entrypoint: npm
args: ['install']
#
# Generate the statis site
#
- name: node:16.14.2
entrypoint: npm
env:
- 'ADDRESSCHANGE_URL=$_ADDRESSCHANGE_URL'
- 'AUTH_API_URL=$_AUTH_API_URL'
- 'AUTH_URL=$_AUTH_URL'
- 'BCA_LEARN_MORE_URL=$_BCA_LEARN_MORE_URL'
- 'BCA_URL=$_BCA_URL'
- 'BCEID_URL=$_BCEID_URL'
- 'BCOL_URL=$_BCOL_URL'
- 'BCREGISTRY_LD_CLIENT_ID=$_BCREGISTRY_LD_CLIENT_ID'
- 'BCROS_BASE_URL=$_BCROS_BASE_URL'
- 'BUS_SEARCH_LEARN_MORE=$_BUS_SEARCH_LEARN_MORE'
- 'BUSINESS_SEARCH_URL=$_BUSINESS_SEARCH_URL'
- 'BUSINESS_URL=$_BUSINESS_URL'
- 'COLIN_URL=$_COLIN_URL'
- 'CSO_LEARN_MORE_URL=$_CSO_LEARN_MORE_URL'
- 'CSO_URL=$_CSO_URL'
- 'ESRA_LEARN_MORE_URL=$_ESRA_LEARN_MORE_URL'
- 'ESRA_URL=$_ESRA_URL'
- 'KEYCLOAK_CONFIG_PATH=$_KEYCLOAK_CONFIG_PATH'
- 'NAME_REQUEST_URL=$_NAME_REQUEST_URL'
- 'ORGBOOK_URL=$_ORGBOOK_URL'
- 'PPR_URL=$_PPR_URL'
- 'REGISTRY_ACCOUNT_CREATE_URL=$_REGISTRY_ACCOUNT_CREATE_URL'
- 'RPT_URL=$_RPT_URL'
- 'SITEMINDER_LOGOUT_URL=$_SITEMINDER_LOGOUT_URL'
- 'SOCIETIES_URL=$_SOCIETIES_URL'
- 'STATUS_API_URL=$_STATUS_API_URL'
- 'WILLS_LEARN_MORE_URL=$_WILLS_LEARN_MORE_URL'
- 'WILLS_URL=$_WILLS_URL'
args: ['--openssl-legacy-provider', 'run', 'generate']
#
# Deploy to firebase channel, using the PR #
# store log to /workspace to get the channel URL
#
- name: gcr.io/yfthig-dev/firebase
entrypoint: bash
args: ['-c', 'firebase hosting:channel:deploy --project=yfthig-dev PR-$_PR_NUMBER > /workspace/firebase-deploy.txt']
#
# Update the PR with the temporary URL
#
- id: "Update the PR"
name: gcr.io/cloud-builders/curl
entrypoint: bash
args:
- -c
- |
# Read from "/workspace"
url=`cat /workspace/firebase-deploy.txt| grep 'Channel URL'| cut -c 77-| cut -d ' ' -f 1`
echo "this is the body:"
echo '{"body": "Temporary Url for review:'"$url"'"}'
curl -X POST \
https://api.github.com/repos/bcgov/bcregistry/issues/$_PR_NUMBER/comments \
--header "Authorization: Token $$TOKEN" \
--header "Accept: application/vnd.github.v3+json" \
--data-binary '{"body": "Temporary Url for review: '"$url"'"}'
secretEnv: ['TOKEN']
availableSecrets:
secretManager:
- versionName: projects/$PROJECT_ID/secrets/github-appkey/versions/latest
env: 'TOKEN'
options:
dynamic_substitutions: true