Created
January 27, 2021 21:15
-
-
Save grant/2ebd8d09ea80295747f40497c18d998b to your computer and use it in GitHub Desktop.
run-workflow-function deploy.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configuration | |
export PROJECT_ID=$(gcloud config get-value core/project) | |
# Deploy Workflow | |
gcloud workflows deploy myFirstWorkflow \ | |
--source=myFirstWorkflow.yaml | |
# Deploy (private) Function | |
gcloud functions deploy runWorkflowFunction \ | |
--runtime nodejs12 \ | |
--region us-central1 \ | |
--entry-point runWorkflow \ | |
--set-env-vars PROJECT_ID=$PROJECT_ID \ | |
--trigger-http \ | |
--no-allow-unauthenticated | |
# Call (private) Function | |
FUNCTION_URL=https://us-central1-$PROJECT_ID.cloudfunctions.net/runWorkflowFunction | |
curl -XPOST -H "Authorization: Bearer $(gcloud auth print-identity-token)" $FUNCTION_URL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment