diff --git a/broker/cloud_run/lsst/classify_snn/construct-name.sh b/broker/cloud_run/lsst/classify_snn/construct-name.sh index 9c73cdc2..81d130c2 100644 --- a/broker/cloud_run/lsst/classify_snn/construct-name.sh +++ b/broker/cloud_run/lsst/classify_snn/construct-name.sh @@ -1,17 +1,13 @@ #!/bin/bash -_usage() { - echo "Usage: $0 [-s|--stem] [[-g|--gcp-service] ]" -} - _info() { - echo "Use '$(basename $0) --help' for more information." + echo "Use '$(basename "$0") --help' for more information." } _help() { echo "Construct the GCP resource name using the supplied options and the env vars SURVEY and TESTID." echo - _usage + echo "Usage: $0 [-s|--stem] [[-g|--gcp-service] ]" echo echo "Options:" echo " -s, --stem Name stem for the resource. SURVEY will be prepended and TESTID " diff --git a/broker/cloud_run/lsst/classify_snn/create-ancillaries.sh b/broker/cloud_run/lsst/classify_snn/create-ancillaries.sh index 67840e23..7edc8caa 100644 --- a/broker/cloud_run/lsst/classify_snn/create-ancillaries.sh +++ b/broker/cloud_run/lsst/classify_snn/create-ancillaries.sh @@ -10,7 +10,6 @@ bq_table_supernnova="supernnova" ps_topic_out=$(construct-name.sh --stem "supernnova") ps_topic_bqimport=$(construct-name.sh --stem "bigquery-import-supernnova") ps_topic_bqimport_deadletter=$(construct-name.sh --stem "bigquery-import-supernnova-deadletter") -ps_subscrip_trigger="$_TRIGGER_TOPIC" ps_subscrip_bqimport="$ps_topic_bqimport" ps_subscrip_bqimport_deadletter="$ps_topic_bqimport_deadletter" diff --git a/broker/cloud_run/lsst/classify_snn/deploy.sh b/broker/cloud_run/lsst/classify_snn/deploy.sh index bb1b2b00..6795f571 100644 --- a/broker/cloud_run/lsst/classify_snn/deploy.sh +++ b/broker/cloud_run/lsst/classify_snn/deploy.sh @@ -2,10 +2,13 @@ # Build the image, create ancillary resources, and deploy the module as a Cloud Run service. # # --------- Example usage ----------------------- -# First, double check the values in env.yaml. Then: +# +# First, double check the values in env.yaml. Then: +# # $ gcloud auth ... -# $ export PROJECT_ID=... (is this set automatically by gcloud auth?) -# $ bash deploy.sh +# $ export PROJECT_ID=... (Is this set automatically by gcloud auth?) +# $ bash deploy.sh # That's it. All variables retrieved from env.yaml. +# # ----------------------------------------------- # --------- Set environment variables ----------- @@ -31,9 +34,12 @@ check_env_vars PROJECT_ID _SURVEY _TESTID MODULE_NAME_STEM MODULE_ROUTE REGION R # Construct and export additional environment variables for cloudbuild.yaml. # Environment variables that will be used by cloudbuild.yaml must start with "_", per GCP's requirements. -export _MODULE_NAME=$(construct-name.sh --stem "$MODULE_NAME_STEM") -export _REPOSITORY=$(construct-name.sh --stem "$REPOSITORY_STEM") -export _TRIGGER_TOPIC=$(construct-name.sh --stem "$TRIGGER_TOPIC_STEM") +_MODULE_NAME=$(construct-name.sh --stem "$MODULE_NAME_STEM") +export _MODULE_NAME="$_MODULE_NAME" +_REPOSITORY=$(construct-name.sh --stem "$REPOSITORY_STEM") +export _REPOSITORY="$_REPOSITORY" +_TRIGGER_TOPIC=$(construct-name.sh --stem "$TRIGGER_TOPIC_STEM") +export _TRIGGER_TOPIC="$_TRIGGER_TOPIC" # ----------------------------------------------- # --------- Project setup -----------------------