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.
This commit is contained in:
Dorian 2014-11-25 23:08:21 -05:00
parent ad7d4011dc
commit 401d0d1b6c
4 changed files with 9 additions and 13 deletions

View File

@ -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; }

View File

@ -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.

View File

@ -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

View File

@ -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: