2015-03-11 22:09:54 -04:00
|
|
|
---
|
2015-05-15 23:53:54 -04:00
|
|
|
- name: verify a deployment package ready for deployment, otherwise skip deployment steps
|
|
|
|
local_action: stat path={{ rookeries_package_path }}
|
|
|
|
sudo: no
|
|
|
|
register: deploy_package
|
|
|
|
|
2015-03-11 22:09:54 -04:00
|
|
|
- name: upload + extract rookeries package to web server home
|
|
|
|
unarchive: src={{ rookeries_package_path }} dest={{ web_root_path }}
|
|
|
|
sudo: yes
|
2015-05-15 23:53:54 -04:00
|
|
|
when: deploy_package.stat.exists
|
2015-03-11 22:09:54 -04:00
|
|
|
|
|
|
|
- name: install rookeries dependencies
|
2015-07-17 08:23:27 -04:00
|
|
|
pip: requirements=requirements.txt virtualenv={{ rookeries_venv }} chdir={{ rookeries_deploy_dir }}
|
2015-05-15 23:53:54 -04:00
|
|
|
when: deploy_package.stat.exists
|
2015-03-11 22:09:54 -04:00
|
|
|
|
2015-06-22 08:09:13 -04:00
|
|
|
# TODO Remove after transition to CouchDB as a store.
|
2015-03-11 22:09:54 -04:00
|
|
|
- name: install extra MySQL python connector dependency
|
|
|
|
pip: name=mysql-connector-python virtualenv={{ rookeries_venv }} version=1.1.6
|
2015-05-15 23:53:54 -04:00
|
|
|
extra_args="--allow-external mysql-connector-python --allow-unverified mysql-connector-python"
|
|
|
|
when: deploy_package.stat.exists
|
2015-03-11 22:09:54 -04:00
|
|
|
|
2015-07-17 08:23:27 -04:00
|
|
|
- name: install frontend dependencies for app
|
|
|
|
npm: path={{ rookeries_deploy_dir }} state=present registry=http://registry.npmjs.org/
|
|
|
|
when: deploy_package.stat.exists
|
|
|
|
|
2015-03-11 22:09:54 -04:00
|
|
|
- name: fix permissions on extracted web app
|
2015-07-17 08:23:27 -04:00
|
|
|
file: path={{ rookeries_deploy_dir }} owner={{ web_server_group }} group={{ web_server_group }}
|
2015-03-11 22:09:54 -04:00
|
|
|
state=directory recurse=yes
|
2015-05-15 23:53:54 -04:00
|
|
|
when: deploy_package.stat.exists
|
2015-03-11 22:09:54 -04:00
|
|
|
|
2015-07-17 08:23:27 -04:00
|
|
|
- name: add in symlink to deployed package.
|
|
|
|
file: state=link src={{ rookeries_deploy_dir }} path={{ rookeries_app_symlink }}
|
|
|
|
owner={{ web_server_group }} group={{ web_server_group }}
|
|
|
|
when: deploy_package.stat.exists
|
|
|
|
|
|
|
|
- name: add in symlink to deployed virtualenv.
|
|
|
|
file: state=link src={{ rookeries_venv }} path={{ rookeries_venv_symlink }}
|
|
|
|
owner={{ web_server_group }} group={{ web_server_group }}
|
2015-05-20 10:47:07 -04:00
|
|
|
notify:
|
|
|
|
- restart uwsgi app
|
2015-05-15 23:53:54 -04:00
|
|
|
when: deploy_package.stat.exists
|