Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@BigAl
Created January 18, 2019 04:43
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 BigAl/9edff5c7e50bae582441fd10661ba556 to your computer and use it in GitHub Desktop.
Save BigAl/9edff5c7e50bae582441fd10661ba556 to your computer and use it in GitHub Desktop.
makefile
# Makefile
COMMITID=$(shell git rev-parse HEAD)
ifndef AWS_DEFAULT_REGION
AWS_DEFAULT_REGION = $(shell aws configure get region)
endif
ifndef AWS_REGION
AWS_REGION = ${AWS_DEFAULT_REGION}
endif
all : deploy-stack
.PHONY : all
deploy-stack: env-STACK_NAME
aws cloudformation deploy --template-file "$(PWD)/master.yml" \
--stack-name $(STACK_NAME) \
--capabilities CAPABILITY_NAMED_IAM
delete-stack: env-STACK_NAME
aws cloudformation delete-stack \
--stack-name $(STACK_NAME)
# Check for specific environment variables
env-%:
@ if [ "${${*}}" = "" ]; then \
echo "Environment variable $* not set"; \
exit 1; \
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment