Skip to content

Instantly share code, notes, and snippets.

@justinmklam
Last active July 9, 2021 21:24
Show Gist options
  • Save justinmklam/82f455e8cb0fdf2a0d62db3beca35156 to your computer and use it in GitHub Desktop.
Save justinmklam/82f455e8cb0fdf2a0d62db3beca35156 to your computer and use it in GitHub Desktop.
Cheat sheet for makefile

Assign output of command to a variable, then use the variable. Needs $<); \ to pipe the output and concatenate the subsequent line, since each line is executed in a separate shell.

# Usage: make db-upgrade-gcp environment=dev
db-upgrade-gcp:
	TOKEN=$$(gcloud auth print-identity-token $<); \
	python bin/db_upgrade_gcp.py $(environment) --gcp_token $$TOKEN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment