Skip to content

Commit

Permalink
Suppression du rôle zmd et remise à place du rôle app
Browse files Browse the repository at this point in the history
  • Loading branch information
Situphen committed Apr 11, 2021
1 parent 20a1f98 commit 5316fb1
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 82 deletions.
1 change: 0 additions & 1 deletion playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@
- role: web
tags: bootstrap
- app
- zmd
- latex
2 changes: 2 additions & 0 deletions roles/app/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ google_analytics_api:
auth_uri: "https://accounts.google.com/o/oauth2/auth"
token_uri: "https://accounts.google.com/o/oauth2/token"
auth_provider_x509_cert_url: "https://www.googleapis.com/oauth2/v1/certs"
zmarkdown_sentry_dsn: ""
zmarkdown_dir: "{{ appdir }}/zmd"
24 changes: 0 additions & 24 deletions roles/app/tasks/frontend.yml

This file was deleted.

70 changes: 68 additions & 2 deletions roles/app/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@
- zds-watchdog.service
tags:
- bootstrap
- name: add zmarkdown unit file
template:
src: zmd.service.j2
dest: /etc/systemd/system/zmd.service
tags:
- bootstrap
- upgrade

- name: create app config file
become: true
Expand All @@ -158,8 +165,27 @@
- bootstrap
- upgrade

- name: build front if repo changed
include_tasks: frontend.yml
- include_role:
name: common
tasks_from: nodejs
tags:
- bootstrap

- name: install frontend
become: true
become_user: "{{ appuser }}"
npm:
path: "{{ appdir }}"
tags:
- bootstrap
- upgrade

- name: build frontend
become: true
become_user: "{{ appuser }}"
command: npm run build
args:
chdir: "{{ appdir }}"
tags:
- bootstrap
- upgrade
Expand Down Expand Up @@ -202,6 +228,16 @@
tags:
- bootstrap

- name: install zmarkdown
become: true
become_user: zds
npm:
path: "{{ zmarkdown_dir }}"
production: yes
tags:
- bootstrap
- upgrade

- name: check if database migration is needed
become: true
become_user: "{{ appuser }}"
Expand Down Expand Up @@ -286,10 +322,40 @@
- bootstrap
- upgrade

- name: start zmarkdown service
systemd:
name: zmd
state: started
enabled: yes
daemon_reload: true
tags:
- bootstrap

- name: reload zmarkdown service
systemd:
name: zmd
state: reloaded
daemon_reload: true
tags:
- bootstrap
- upgrade

- name: ensure that zmarkdown is running
uri:
url: http://localhost:27272/
return_content: yes
register: this
delay: 1
retries: 10
until: "'zmd is running' in this.content"
tags:
- bootstrap

- name: remove maintenance symlink
file:
path: "{{ webroot }}/maintenance.html"
state: absent
tags:
- bootstrap
- upgrade

File renamed without changes.
2 changes: 0 additions & 2 deletions roles/zmd/defaults/main.yml

This file was deleted.

53 changes: 0 additions & 53 deletions roles/zmd/tasks/main.yml

This file was deleted.

0 comments on commit 5316fb1

Please sign in to comment.