MT#12487 fixes

- force uwsgi to use python 2.7 ( django 1.8 requirement )
- set /var/lib/repoapi as destination for venv_prod
- debian/rules set VAR_DIR in order not to install venv_prod

Change-Id: I900087558268896798d3d9fe0957c5d733c6346b
changes/85/1785/3
Victor Seva 10 years ago
parent 8fe0fcc523
commit 4fe357fb4d

@ -1,3 +1,5 @@
VAR_DIR ?= /var/lib/repoapi
# do nothing by default # do nothing by default
all: all:
@ -19,8 +21,8 @@ venv_dev: requirements/dev.txt
.ONESHELL: .ONESHELL:
SHELL = /bin/bash SHELL = /bin/bash
venv_prod: requirements/prod.txt venv_prod: requirements/prod.txt
virtualenv --python=python2.7 venv_prod virtualenv --python=python2.7 $(VAR_DIR)/venv_prod
source ./venv_prod/bin/activate && \ source $(VAR_DIR)/venv_prod/bin/activate && \
pip install -r ./requirements/prod.txt > install.log pip install -r ./requirements/prod.txt > install.log
################################### ###################################
@ -29,7 +31,7 @@ test: venv_test
./manage.py jenkins --settings="repoapi.settings.dev" ./manage.py jenkins --settings="repoapi.settings.dev"
deploy: venv_prod deploy: venv_prod
source ./venv_prod/bin/activate && \ source $(VAR_DIR)/venv_prod/bin/activate && \
./manage.py collectstatic --noinput --settings="repoapi.settings.prod" ./manage.py collectstatic --noinput --settings="repoapi.settings.prod"
chown www-data:www-data -R ./static_media/ chown www-data:www-data -R ./static_media/

4
debian/rules vendored

@ -16,10 +16,10 @@ override_dh_auto_test:
override_dh_auto_install: override_dh_auto_install:
echo "fakesecretkey" > .secret_key echo "fakesecretkey" > .secret_key
make deploy VAR_DIR=$(shell pwd) make deploy
make clean make clean
override_dh_fixperms: override_dh_fixperms:
dh_fixperms dh_fixperms
chmod 4750 debian/repoapi/var/lib/repoapi chmod 4770 debian/repoapi/var/lib/repoapi
chown www-data:www-data debian/repoapi/var/lib/repoapi chown www-data:www-data debian/repoapi/var/lib/repoapi

@ -1,6 +1,8 @@
[uwsgi] [uwsgi]
# Django-related settings # Django-related settings
# django 1.8 needs python >= 2.7
plugin = python27
# the base directory (full path) # the base directory (full path)
chdir = /usr/share/repoapi chdir = /usr/share/repoapi
# Django's wsgi file # Django's wsgi file

Loading…
Cancel
Save