Skip to content

Instantly share code, notes, and snippets.

@s-aska
Created May 14, 2021 19:33
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 s-aska/adf2e4b11e0681a3e70617a3331cd751 to your computer and use it in GitHub Desktop.
Save s-aska/adf2e4b11e0681a3e70617a3331cd751 to your computer and use it in GitHub Desktop.
deploy-function ではじまるすべてのターゲットを実行する Makefile
PROJECT_ID="some-project-id"
ENV="dev"
TARGETS=$(shell grep -E '^deploy-function[a-zA-Z_-]+:' $(MAKEFILE_LIST) | cut -d : -f 1)
deploy-all: $(TARGETS)
deploy-function_some:
gcloud --project $(PROJECT_ID) functions deploy --region asia-northeast1 SomeFunction \
--set-env-vars PROJECT_ID=$(PROJECT_ID),RUNTIME_ENVIRONMENT=$(ENV) \
--runtime go111 \
--timeout 540s \
--trigger-resource "some-resources" \
--trigger-event google.storage.object.finalize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment