docs: systemd
Deploy bin / deploy (push) Successful in 3s
Deploy service MASTER / deploy (push) Successful in 6s

This commit is contained in:
Benjamin Labrecque
2026-07-06 15:43:45 +02:00
parent fcee7b91c4
commit d04aeff4c2
2 changed files with 53 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
# - name: Deploy Service
# hosts: localhost
# gather_facts: yes # Required to get the user UID dynamically
#
# vars:
# - workspace_dir: "/tmp/hla_framework_bd"
# - svc_current_dir: /sls/bd/hla/dev/services/000-master/current
# - app_dir: "{{ svc_current_dir }}/app"
#
# tasks:
# - name: Clone this repository
# ansible.builtin.git:
# repo: "git@gitea.psi.ch:sls/hla_framework_bd.git"
# dest: "{{ workspace_dir }}"
# version: main
# accept_hostkey: true
#
# - name: Sync service deployment files
# ansible.builtin.copy:
# src: ./services/000-master/
# dest: "{{ svc_current_dir }}/"
# mode: 'preserve'
#
# - name: Initialize and sync virtual environment with uv
# ansible.builtin.command:
# cmd: uv venv --allow-existing --system-site-packages .venv
# chdir: "{{ app_dir }}"
# changed_when: false
#
# - name: Sync dependencies with uv
# ansible.builtin.command:
# cmd: uv sync
# chdir: "{{ app_dir }}"
# changed_when: false
#
# - name: Manage systemd user service
# ansible.builtin.systemd:
# name: "{{ svc_current_dir }}/systemd/AGEBD-SERVICE-MASTER.service"
# state: restarted
# enabled: yes
# force: yes
# scope: user
# daemon_reload: yes
# environment:
# XDG_RUNTIME_DIR: "/run/user/{{ ansible_effective_user_id }}"
+8
View File
@@ -0,0 +1,8 @@
# Systemd Service
## Check all logs
```
sudo su svcusr-sls2hla
journalctl --user -u AGEBD-SERVICE-MASTER.service
```