Add new symlink based deployment setup for Rookeries.
This commit is contained in:
parent
3a1cad7105
commit
9c99d02544
|
@ -18,9 +18,16 @@ rookeries_environ_type: dev
|
|||
# Name of the rookeries app
|
||||
rookeries_app_name: rookeries
|
||||
rookeries_version: 0.4.9
|
||||
|
||||
# Rookeries deployment configuration
|
||||
rookeries_app_hostname: localhost
|
||||
rookeries_local_uwsgi_port: 8001
|
||||
|
||||
# TODO Clean up and factor out once better developed.
|
||||
rookeries_deploy_source: "{{ rookeries_app_name }}-{{ rookeries_version }}-{{ rookeries_app_hostname }}"
|
||||
rookeries_deploy_target: "{{ rookeries_app_name }}_{{ rookeries_app_hostname }}"
|
||||
|
||||
|
||||
# The default configuration for running rookeries
|
||||
rookeries_app_config:
|
||||
|
||||
|
|
|
@ -13,9 +13,10 @@ galaxy_info:
|
|||
- development
|
||||
- web
|
||||
dependencies:
|
||||
- { role: dorianpula.nginx-uwsgi-supervisor,
|
||||
app_name: "{{ rookeries_app_name }}",
|
||||
app_nginx_hostname: "{{ rookeries_app_hostname }}",
|
||||
app_uwsgi_port: "{{ rookeries_local_uwsgi_port }}",
|
||||
app_uwsgi_executable: "rookeries:make_rookeries_app()",
|
||||
app_uwsgi_envs: "{{ rookeries_app_config }}"}
|
||||
- role: dorianpula.nginx-uwsgi-supervisor
|
||||
app_name: "{{ rookeries_app_name }}"
|
||||
app_root_path: "{{ rookeries_app_symlink }}"
|
||||
app_nginx_hostname: "{{ rookeries_app_hostname }}"
|
||||
app_uwsgi_port: "{{ rookeries_local_uwsgi_port }}"
|
||||
app_uwsgi_executable: "rookeries:make_rookeries_app()"
|
||||
app_uwsgi_envs: "{{ rookeries_app_config }}"
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
when: rookeries_db.setup_db
|
||||
|
||||
- name: add MySQL database users for rookeries.
|
||||
mysql_user: name={{ rookeries_db.username }} password={{ rookeries_db.password }} priv={{ rookeries_db.db_name }}:ALL
|
||||
mysql_user: name={{ rookeries_db.username }} password={{ rookeries_db.password }}
|
||||
priv={{ rookeries_db.db_name }}.*:ALL
|
||||
login_host={{ rookeries_db.host }} login_port={{ rookeries_db.port }}
|
||||
when: rookeries_db.setup_db
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
when: deploy_package.stat.exists
|
||||
|
||||
- name: install rookeries dependencies
|
||||
pip: requirements=requirements.txt virtualenv={{ rookeries_venv }} chdir={{ app_root_path }}
|
||||
pip: requirements=requirements.txt virtualenv={{ rookeries_venv }} chdir={{ rookeries_deploy_dir }}
|
||||
when: deploy_package.stat.exists
|
||||
|
||||
# TODO Remove after transition to CouchDB as a store.
|
||||
|
@ -19,13 +19,23 @@
|
|||
extra_args="--allow-external mysql-connector-python --allow-unverified mysql-connector-python"
|
||||
when: deploy_package.stat.exists
|
||||
|
||||
- name: install frontend dependencies for app
|
||||
npm: path={{ rookeries_deploy_dir }} state=present registry=http://registry.npmjs.org/
|
||||
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 }}
|
||||
file: path={{ rookeries_deploy_dir }} 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/
|
||||
- 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 }}
|
||||
notify:
|
||||
- restart uwsgi app
|
||||
when: deploy_package.stat.exists
|
||||
|
|
|
@ -3,9 +3,14 @@
|
|||
app_name: "{{ rookeries_app_name }}"
|
||||
|
||||
# Introduced from deployment playbook
|
||||
rookeries_venv: "{{ virtualenv_root_path }}/{{ rookeries_app_name }}"
|
||||
|
||||
rookeries_package: "{{ rookeries_app_name }}-{{ rookeries_version }}.tar.bz2"
|
||||
|
||||
rookeries_package: "{{ rookeries_deploy_source }}.tar.bz2"
|
||||
rookeries_deploy_dir: "{{ web_root_path }}/{{ rookeries_deploy_source }}"
|
||||
rookeries_venv: "{{ virtualenv_root_path }}/{{ rookeries_deploy_source }}"
|
||||
rookeries_app_symlink: "{{ web_root_path }}/{{ rookeries_deploy_target }}"
|
||||
rookeries_venv_symlink: "{{ virtualenv_root_path }}/{{ rookeries_deploy_target }}"
|
||||
|
||||
rookeries_package_path: "{{ rookeries_package }}"
|
||||
|
||||
# Extra virtualenv if working in a dev environment to provide the mailsink testing server
|
||||
|
|
Loading…
Reference in New Issue