forked from metaspace2020/sm-engine-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweb_app_deploy_tasks.yml
38 lines (31 loc) · 1.16 KB
/
web_app_deploy_tasks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
- name: Pull sources from the repository
git: repo=https://github.com/SpatialMetabolomics/SM_distributed.git
dest={{ sm_home }}
version={{ sm_branch }}
# - name: Install all needed js libs
# shell: npm install
# args:
# chdir: "{{ project_path }}/webapp"
# - name: Compile static resources
# shell: npm run build
# args:
# chdir: "{{ project_path }}/webapp"
- name: Check if supervisord daemon is running
shell: "{{ activate_venv }} && supervisorctl status"
args:
executable: /bin/bash
register: supervisorctl_status_out
- debug: var=supervisorctl_status_out
- name: Start supervisord daemon
shell: "{{ activate_venv }} && supervisord -c /etc/supervisor/supervisord.conf -l {{ sm_home }}/supervisord.log"
args:
executable: /bin/bash
when: "'no such file' in supervisorctl_status_out.stdout"
- name: Restart the tornado web app running under supervisor
shell: "{{ activate_venv }} && supervisorctl restart all"
args:
executable: /bin/bash
when: "'sm-web-app' in supervisorctl_status_out.stdout"
register: command_result
failed_when: "'ERROR' in command_result.stdout"
- debug: var=command_result