Last active
June 9, 2016 07:11
-
-
Save echo-devnull/e9e2537e342e15cce74b6837db94824e to your computer and use it in GitHub Desktop.
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
DATE = $(shell date) | |
TF_ENV="base" | |
REGION=eu-west-1 | |
TF_BUCKET=bucket-name | |
PLANNED_STATE_FILE=/tmp/${TF_ENV}-planned.terraform | |
all: init get plan apply | |
restart: minidestroy plan apply | |
init: | |
@echo "Setting remote S3 state to ${TF_ENV}.tfstate" | |
terraform remote config -backend=s3 -backend-config="bucket=${TF_BUCKET}" -backend-config="key=${TF_ENV}.tfstate" -backend-config="region=${REGION}" | |
get: | |
@echo "Getting terraform modules" | |
terraform get | |
plan: | |
terraform plan -out=${PLANNED_STATE_FILE} | |
apply: | |
terraform apply ${PLANNED_STATE_FILE} | |
clean: | |
terraform destroy | |
rm -rf .terraform | |
minidestroy: | |
terraform destroy -target=aws_instance.coreos-t1-micro-1a | |
release: | |
@echo "Enter commit message:" | |
@read REPLY; \ | |
echo "${DATE} - $$REPLY" >> CHANGELOG; \ | |
git add --all; \ | |
git commit -m "$$REPLY"; \ | |
git push | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment