Skip to content

Instantly share code, notes, and snippets.

@rcy
Last active December 24, 2015 00:59
Show Gist options
  • Save rcy/6720157 to your computer and use it in GitHub Desktop.
Save rcy/6720157 to your computer and use it in GitHub Desktop.
branch specific deployments to %.meteor.com
PROJECT=myapp
BRANCH=$(shell git branch | sed -n '/\* /s///p')
TAG=deploy-${BRANCH}-$(shell echo -n `date +%Y%m%d%H%M%S`)
ifeq (${BRANCH}, master)
TARGET=${PROJECT}.meteor.com
else
TARGET=${BRANCH}-${PROJECT}.meteor.com
endif
all:
@echo current branch is ${BRANCH}
@echo use: \"make deploy\" to deploy to ${TARGET} and git tag ${TAG}
deploy:
cd app && mrt deploy ${TARGET} --password
git tag ${TAG}
destroy:
@echo "WARNING! THIS WILL DELETE THE APPLICATION AND DATABASE ON ${TARGET}"
@echo "TYPE 'DELETE' TO PROCEED"
@read a ; /usr/bin/test "$$a" == "DELETE"
cd app && mrt deploy ${TARGET} --delete
reset: destroy deploy
logs:
cd app && mrt logs ${TARGET}
.PHONY: test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment