From 401d0d1b6cc342365f1b0adf37d6367ab243d0a1 Mon Sep 17 00:00:00 2001 From: Dorian Pula Date: Tue, 25 Nov 2014 23:08:21 -0500 Subject: [PATCH] Migrate package deployment to use plain old tar ball over pip. Fix up UWSGI configs for setup. Add fix for nodejs. Refactor clean utilities into a separate module. Remove setuptools artifacts. --- config/nginx/rookeries-uwsgi.conf | 2 +- deployment/rookeries_install.yaml | 14 +++++--------- pre_deployment/base_linux.yaml | 3 --- pre_deployment/nodejs.yaml | 3 +++ 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/config/nginx/rookeries-uwsgi.conf b/config/nginx/rookeries-uwsgi.conf index 9de9165..68b6955 100644 --- a/config/nginx/rookeries-uwsgi.conf +++ b/config/nginx/rookeries-uwsgi.conf @@ -3,7 +3,7 @@ server { server_name localhost; location /static/ { - alias /srv/www/rookeries/rookeries/static/; + alias /srv/www/rookeries_webapp/rookeries/static/; } location / { try_files $uri @yourapplication; } diff --git a/deployment/rookeries_install.yaml b/deployment/rookeries_install.yaml index 936be27..bf0d4e5 100644 --- a/deployment/rookeries_install.yaml +++ b/deployment/rookeries_install.yaml @@ -1,24 +1,20 @@ --- - hosts: all + sudo: yes vars: web_server_home: /srv/www rookeries_venv: "{{ web_server_home }}/rookeries" rookeries_package: rookeries-0.4.0.tar.bz2 - rookeries_uwsgi_ini: rookeries-uwsgi.ini tasks: - - name: Upload rookeries package to web server home - copy: src=../../../dist/{{ rookeries_package }} dest={{ web_server_home }} + - name: upload + extract rookeries package to web server home + unarchive: src=../../../{{ rookeries_package }} dest={{ web_server_home }} - - name: PIP install rookeries package into target virtualenv - pip: name={{ rookeries_package }} virtualenv={{ rookeries_venv }} chdir={{ web_server_home }} + - name: pip install rookeries dependencies into target virtualenv + pip: requirements=rookeries_webapp/requirements.txt virtualenv={{ rookeries_venv }} chdir={{ web_server_home }} - name: PIP install extra MySQL python connector dependency pip: name=mysql-connector-python virtualenv={{ rookeries_venv }} version=1.1.6 extra_args='--allow-external mysql-connector-python --allow-unverified mysql-connector-python' - # TODO This is problematic, and maybe a good sign why deploying a web app via pip isn't the wisest idea. - - name: Link rookeries static pages to top-level of virtualenv - file: src={{ rookeries_venv }}/lib/python2.7/site-packages/rookeries/ dest={{ rookeries_venv }}/rookeries state=link - # TODO Step 4 - Setup environment variables on target system related to config. diff --git a/pre_deployment/base_linux.yaml b/pre_deployment/base_linux.yaml index 92bffed..5ecb0a1 100644 --- a/pre_deployment/base_linux.yaml +++ b/pre_deployment/base_linux.yaml @@ -3,9 +3,6 @@ sudo: yes tasks: - - name: Update and upgrade system - apt: update_cache=yes upgrade=full - - name: Install vim apt: pkg=vim state=present diff --git a/pre_deployment/nodejs.yaml b/pre_deployment/nodejs.yaml index 3261ea3..4d98f99 100644 --- a/pre_deployment/nodejs.yaml +++ b/pre_deployment/nodejs.yaml @@ -9,6 +9,9 @@ - nodejs - npm + - name: link nodejs binary correctly + file: src=/usr/bin/nodejs dest=/usr/bin/node state=link + - name: Setup coffeescript + lessc dependency npm: name={{ item }} global=yes state=present with_items: