First version
[fnpdeploy.git] / deploy_setup / templates / Makefile
1 HERE:=$(dir $(abspath $(lastword $(MAKEFILE_LIST))))
2
3
4
5
6 .PHONY: release
7
8 .ONESHELL:
9 release:
10         . etc/deployment.cfg
11         export PATH=$(abspath $$VIRTUALENV_PATH)/bin:$(PATH)
12         # Get current release from the repository.
13         RELEASE=$$(date -Is)
14         git clone -s $$GIT_REPO releases/$$RELEASE
15
16         # Make sure the virtualenv exists.
17         [ -e $$VIRTUALENV_PATH ] || $$VIRTUALENV_CMD $$VIRTUALENV_PATH
18
19         # If there's a etc/requirements.txt, install it.
20         [ -e etc/requirements.txt ] && $$VIRTUALENV_PATH/bin/pip install -r etc/requirements.txt
21
22         # Do 'make deploy' in release directory.
23         $(MAKE) -C releases/$$RELEASE -f $(HERE)etc/.supply-configuration.mk deploy
24
25         [ -e releases/current ] && cp --no-dereference --no-target-directory releases/current releases/previous
26         ln -sf --no-target-directory $$RELEASE releases/current
27
28         supervisorctl restart $$SUPERVISOR_TASKS
29