FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit 0321edff authored by Dmitrii Unterov's avatar Dmitrii Unterov
Browse files

ci: add SHORT_TEST_PREFIX variable

parent 056789d0
No related branches found
No related tags found
1 merge request!64ci: add SHORT_TEST_PREFIX variable
Pipeline #486807 passed
......@@ -13,6 +13,11 @@ cleanup() {
trap 'cleanup' EXIT INT TERM
TEST_PREFIX="test-rapp"
# Workaround to detect cloud functions created by GCP Minimal Site Monitoring module.
# The cloud functions created by this module use `short_service_name`, (first 8 symbols).
# https://gitlab.developers.cam.ac.uk/uis/devops/infra/terraform/gcp-site-monitoring/-/blob/master/locals.tf?ref_type=heads#L74
# SHORT_TEST_PREFIX is used later in this script in "Cleaning up Cloud Functions..." block.
SHORT_TEST_PREFIX="${TEST_PREFIX:0:8}"
GCP_PROJECT="infra-testing-int-e2395220"
GCP_PROJECT_META="infra-testing-meta-21f09a44"
GCP_REGION="europe-west2"
......@@ -45,7 +50,7 @@ done
echo "Cleaning up Cloud Functions..."
mapfile -t functions < <(
gcloud --project="$GCP_PROJECT" functions list \
--filter="name ~ .*${TEST_PREFIX}.*" --format="value(name)"
--filter="name ~ .*${SHORT_TEST_PREFIX}.*" --format="value(name)"
)
for function in "${functions[@]}"; do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment