From cc8e75e5918032c346c0a925f2b819c49ed98b77 Mon Sep 17 00:00:00 2001 From: Matthieu Bessat Date: Mon, 15 Jul 2024 11:57:27 +0200 Subject: [PATCH] fix(ppq): attempt to fix gitwatch --- ansible/roles/popequer_notebook/tasks/main.yaml | 4 ++++ ansible/templates/scripts/gitwatch.sh | 3 +++ ansible/templates/systemd/user/popequer_gitwatch@.service | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 ansible/templates/scripts/gitwatch.sh diff --git a/ansible/roles/popequer_notebook/tasks/main.yaml b/ansible/roles/popequer_notebook/tasks/main.yaml index f7ec4d7..02cb237 100644 --- a/ansible/roles/popequer_notebook/tasks/main.yaml +++ b/ansible/roles/popequer_notebook/tasks/main.yaml @@ -6,6 +6,10 @@ ansible.builtin.git: repo: "git@forge.lefuturiste.fr:mbess/main-popequer-notebook.git" dest: /home/mbess/notebooks/personal +- name: Copy gitwatch script + template: + src: scripts/gitwatch.sh + dest: "{{ home }}/.local/bin/ppq_gitwatch" - name: Setup gitwatch systemd_service: scope: user diff --git a/ansible/templates/scripts/gitwatch.sh b/ansible/templates/scripts/gitwatch.sh new file mode 100644 index 0000000..33f0cde --- /dev/null +++ b/ansible/templates/scripts/gitwatch.sh @@ -0,0 +1,3 @@ +#!/usr/bin/sh + +/usr/bin/gitwatch -r -R origin -s 300 -m "docs: update from {{ device_name }}" {{ home }}/notebooks/$1 diff --git a/ansible/templates/systemd/user/popequer_gitwatch@.service b/ansible/templates/systemd/user/popequer_gitwatch@.service index 4b63431..1929673 100644 --- a/ansible/templates/systemd/user/popequer_gitwatch@.service +++ b/ansible/templates/systemd/user/popequer_gitwatch@.service @@ -4,7 +4,7 @@ Description=Sync popequer notebook with git [Service] # the buffer period in seconds 5min = 300s Type=simple -ExecStart=/usr/bin/gitwatch -r -R origin -s 300 -m "docs: update from {{ device_name }}" {{ home }}/notebooks/%i +ExecStart={{ home }}/.local/bin/gitwatch /%i ExecStop=/bin/true Restart=always RestartSec=30