-
Notifications
You must be signed in to change notification settings - Fork 283
/
cloudbuild.yaml
57 lines (52 loc) · 1.97 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
52
53
54
55
56
57
# Google Cloud Build script for bqutils
#
# This build script is used to deploy the open-source bqutil GitHub repository
# for every change pushed.
#
# Manual Execution:
# Use the below command to invoke the build manually. Note the substitutions for
# BRANCH_NAME and REVISION_ID. These variables are normally populated when the
# build is executed via build triggers but will be empty during manual
# execution. Dummy branch and revisions can be passed during manual execution so
# the artifacts can be uploaded upon build completion.
#
# gcloud builds submit . --config=cloudbuild.yaml
#
steps:
############################################################
# Fetches master branch from GitHub and then hard "resets"
# to the _PR_NUMBER which triggered this build. This enables
# build.sh to build only what's changed relative to the
# master branch by checking the output of "git diff".
############################################################
- name: gcr.io/cloud-builders/git
entrypoint: bash
args:
- release/git_init.sh
env:
- _REPO_URL=${_REPO_URL}
- BRANCH_NAME=${BRANCH_NAME}
- _PR_NUMBER=${_PR_NUMBER}
###########################################################
# Build and deploy
# (only deploy if triggered by a commit to master branch)
###########################################################
- name: gcr.io/$PROJECT_ID/bq_udf_ci:infrastructure-public-image-bqutil
entrypoint: bash
args:
- release/build.sh
env:
- PROJECT_ID=${PROJECT_ID}
- BRANCH_NAME=${BRANCH_NAME}
- SHORT_SHA=${SHORT_SHA}
- _JS_BUCKET=${_JS_BUCKET}
- _PR_NUMBER=${_PR_NUMBER}
- _BQ_LOCATION=${_BQ_LOCATION}
- _BUILD_IMAGE=${_BUILD_IMAGE}
substitutions:
_JS_BUCKET: gs://bqutil-lib/test_bq_js_libs/${SHORT_SHA} # default value
_REPO_URL: https://github.com/GoogleCloudPlatform/bigquery-utils.git # default value
timeout: 1800s # 30 minutes
options:
pool:
name: projects/${PROJECT_ID}/locations/us-central1/workerPools/udf-unit-testing