From 4fe357fb4d57b375dfc124946557c2a5467a2ab4 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Thu, 30 Apr 2015 11:29:29 +0200 Subject: [PATCH] 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 --- Makefile | 8 +++++--- debian/rules | 4 ++-- repoapi.ini | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 5d7fe90..fe18cb2 100644 --- a/Makefile +++ b/Makefile @@ -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/ diff --git a/debian/rules b/debian/rules index 758789b..731b93d 100755 --- a/debian/rules +++ b/debian/rules @@ -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 diff --git a/repoapi.ini b/repoapi.ini index c0dfa50..1ea4eaa 100644 --- a/repoapi.ini +++ b/repoapi.ini @@ -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