32 lines
1.2 KiB
YAML
32 lines
1.2 KiB
YAML
---
|
|
- name: verify a deployment package ready for deployment, otherwise skip deployment steps
|
|
local_action: stat path={{ rookeries_package_path }}
|
|
sudo: no
|
|
register: deploy_package
|
|
|
|
- name: upload + extract rookeries package to web server home
|
|
unarchive: src={{ rookeries_package_path }} dest={{ web_root_path }}
|
|
sudo: yes
|
|
when: deploy_package.stat.exists
|
|
|
|
- name: install rookeries dependencies
|
|
pip: requirements=requirements.txt virtualenv={{ rookeries_venv }} chdir={{ app_root_path }}
|
|
when: deploy_package.stat.exists
|
|
|
|
# TODO Remove after transition to CouchDB as a store.
|
|
- name: 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"
|
|
when: deploy_package.stat.exists
|
|
|
|
- name: fix permissions on extracted web app
|
|
file: path={{ app_root_path }} owner={{ web_server_group }} group={{ web_server_group }}
|
|
state=directory recurse=yes
|
|
when: deploy_package.stat.exists
|
|
|
|
- name: install frontend dependencies for app
|
|
npm: path={{ app_root_path }} state=present registry=http://registry.npmjs.org/
|
|
notify:
|
|
- restart uwsgi app
|
|
when: deploy_package.stat.exists
|