Skip to content

Commit

Permalink
chore: remove hardcoded function name and entry point from deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
chapati23 committed Jul 24, 2024
1 parent 3ac9ce5 commit 9380336
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions deploy-via-gcloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
set -e # fail on any error
set -o pipefail # ensure non-zero exit codes are propagated in piped commands

entry_point="watchdogNotifier"
function_name="watchdog-notifications"
region="europe-west1"

printf "Looking up function name..."
function_name=$(gcloud functions list --format="value(name)" | grep '^watchdog-notifications')
printf ' \033[1m%s\033[0m\n' "${function_name}"

printf "Looking up entry point..."
entry_point=$(gcloud functions describe "${function_name}" --region="${region}" --format json | jq .buildConfig.entryPoint)
printf ' \033[1m%s\033[0m\n' "${entry_point}"

printf "Looking up project ID..."
project_name="governance-watchdog"
project_id=$(gcloud projects list --filter="name:${project_name}*" --format="value(projectId)")
Expand Down

0 comments on commit 9380336

Please sign in to comment.