Update deployment pipeline, Makefile and README

- Makefile: add install_dev, install_prod, migrations, clear_prod, maintenance commands
- Playbook: full deploy flow (maintenance, stop, install, start, migrate, clear, caddy, messenger)
- Supervisor config for 2 messenger instances
- Workflow: SSH key setup with server IP
- hosts.ini: use IP instead of domain, sudo without password
- README: full documentation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Serreau Jovann
2026-03-18 20:52:01 +01:00
parent f822a9a069
commit 507500e20d
6 changed files with 188 additions and 17 deletions

View File

@@ -5,6 +5,12 @@
vars_files:
- vault.yml
pre_tasks:
- name: Enable maintenance mode
command: make maintenance_on
args:
chdir: /var/www/e-ticket
tasks:
- name: Ensure Caddy sites directory exists
file:
@@ -14,6 +20,31 @@
group: root
mode: "0755"
- name: Stop production containers
command: make stop_prod
args:
chdir: /var/www/e-ticket
- name: Install dependencies and build assets
command: make install_prod
args:
chdir: /var/www/e-ticket
- name: Start production containers
command: make start_prod
args:
chdir: /var/www/e-ticket
- name: Run migrations
command: make migrate_prod
args:
chdir: /var/www/e-ticket
- name: Clear cache
command: make clear_prod
args:
chdir: /var/www/e-ticket
- name: Deploy Caddy config
template:
src: caddy.j2
@@ -23,8 +54,26 @@
mode: "0644"
notify: Reload Caddy
- name: Deploy Messenger supervisor config
template:
src: messenger.j2
dest: /etc/supervisor/conf.d/e-ticket.conf
owner: root
group: root
mode: "0644"
notify: Reload Supervisor
post_tasks:
- name: Disable maintenance mode
command: make maintenance_off
args:
chdir: /var/www/e-ticket
handlers:
- name: Reload Caddy
systemd:
name: caddy
state: reloaded
- name: Reload Supervisor
command: supervisorctl reread && supervisorctl update