Skip to content

Instantly share code, notes, and snippets.

@grant
Created January 27, 2021 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grant/2ebd8d09ea80295747f40497c18d998b to your computer and use it in GitHub Desktop.
Save grant/2ebd8d09ea80295747f40497c18d998b to your computer and use it in GitHub Desktop.
run-workflow-function deploy.sh
# 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