HERE:=$(dir $(abspath $(lastword $(MAKEFILE_LIST)))) .PHONY: release .ONESHELL: release: . etc/deployment.cfg export PATH=$(abspath $$VIRTUALENV_PATH)/bin:$(PATH) # Get current release from the repository. RELEASE=$$(date -Is) git clone -s $$GIT_REPO releases/$$RELEASE # Make sure the virtualenv exists. [ -e $$VIRTUALENV_PATH ] || $$VIRTUALENV_CMD $$VIRTUALENV_PATH # If there's a etc/requirements.txt, install it. [ -e etc/requirements.txt ] && $$VIRTUALENV_PATH/bin/pip install -r etc/requirements.txt # Do 'make deploy' in release directory. $(MAKE) -C releases/$$RELEASE -f $(HERE)etc/.supply-configuration.mk deploy [ -e releases/current ] && cp --no-dereference --no-target-directory releases/current releases/previous ln -sf --no-target-directory $$RELEASE releases/current supervisorctl restart $$SUPERVISOR_TASKS