Skip to content

Commit 1ce1e6c

Browse files
authored
make _TEST_DATA_GCS_BUCKET env variable available to both build and deploy paths of ci/cd pipeline (#501)
1 parent c867013 commit 1ce1e6c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

release/build.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ function deploy_udfs() {
240240
--config="${UDF_DIR}"/cloudbuild.yaml \
241241
--polling-interval="10" \
242242
--worker-pool="projects/${PROJECT_ID}/locations/us-central1/workerPools/udf-unit-testing" \
243-
--substitutions SHORT_SHA=,_JS_BUCKET="${_JS_BUCKET}",_BQ_LOCATION="${_BQ_LOCATION}"
243+
--substitutions SHORT_SHA=,_JS_BUCKET="${_JS_BUCKET}",_BQ_LOCATION="${_BQ_LOCATION},"_TEST_DATA_GCS_BUCKET="${_TEST_DATA_GCS_BUCKET}"
244244
}
245245

246246
#######################################
@@ -254,6 +254,9 @@ function deploy_udfs() {
254254
# None
255255
#######################################
256256
function main() {
257+
# Add SHORTSHA to _TEST_DATA_GCS_BUCKET env variable
258+
# to prevent collisions between concurrent builds
259+
export _TEST_DATA_GCS_BUCKET="${_TEST_DATA_GCS_BUCKET}/${SHORT_SHA}"
257260
# Only deploy UDFs when building master branch and there is
258261
# no associated pull request, meaning the PR was approved
259262
# and this is now building a commit on master branch.
@@ -263,10 +266,9 @@ function main() {
263266
# names do not get the SHORT_SHA value added as a suffix.
264267
cd "${SP_DIR}" && export SHORT_SHA="" && ./deploy.sh
265268
else
266-
# Add SHORTSHA to _JS_BUCKET and _TEST_DATA_GCS_BUCKET env variables
269+
# Add SHORTSHA to _JS_BUCKET env variable
267270
# to prevent collisions between concurrent builds
268271
export _JS_BUCKET="${_JS_BUCKET}/${SHORT_SHA}"
269-
export _TEST_DATA_GCS_BUCKET="${_TEST_DATA_GCS_BUCKET}/${SHORT_SHA}"
270272
build
271273
dry_run_all_sql
272274
fi

0 commit comments

Comments
 (0)