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
all:
@ -19,8 +21,8 @@ venv_dev: requirements/dev.txt
.ONESHELL:
SHELL = /bin/bash
venv_prod: requirements/prod.txt
virtualenv --python=python2.7 venv_prod
source ./venv_prod/bin/activate && \
virtualenv --python=python2.7 $(VAR_DIR)/venv_prod
source $(VAR_DIR)/venv_prod/bin/activate && \
pip install -r ./requirements/prod.txt > install.log
###################################
@ -29,7 +31,7 @@ test: venv_test
./manage.py jenkins --settings="repoapi.settings.dev"
deploy: venv_prod
source ./venv_prod/bin/activate && \
source $(VAR_DIR)/venv_prod/bin/activate && \
./manage.py collectstatic --noinput --settings="repoapi.settings.prod"
chown www-data:www-data -R ./static_media/

4
debian/rules vendored

@ -16,10 +16,10 @@ override_dh_auto_test:
override_dh_auto_install:
echo "fakesecretkey" > .secret_key
make deploy
VAR_DIR=$(shell pwd) make deploy
make clean
override_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

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

Loading…
Cancel
Save