Skip to content

Commit

Permalink
Fixes for Codacy
Browse files Browse the repository at this point in the history
  • Loading branch information
troyraen committed Mar 11, 2025
1 parent 7878181 commit ce60feb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
8 changes: 2 additions & 6 deletions broker/cloud_run/lsst/classify_snn/construct-name.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
#!/bin/bash

_usage() {
echo "Usage: $0 [-s|--stem] <stem> [[-g|--gcp-service] <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] <stem> [[-g|--gcp-service] <gcp_service>]"
echo
echo "Options:"
echo " -s, --stem <stem> Name stem for the resource. SURVEY will be prepended and TESTID "
Expand Down
1 change: 0 additions & 1 deletion broker/cloud_run/lsst/classify_snn/create-ancillaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
18 changes: 12 additions & 6 deletions broker/cloud_run/lsst/classify_snn/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 -----------
Expand All @@ -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 -----------------------
Expand Down

0 comments on commit ce60feb

Please sign in to comment.