From 1837f2c9b1a00ce2d50ebb5f8c63032993a5d000 Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Wed, 26 Aug 2026 08:48:58 +0100 Subject: etherpad auto-updates --- roles/etherpad/tasks/main.yml | 12 ++++++++++++ roles/etherpad/templates/update_etherpad | 12 ++++++++++++ todo.txt | 1 - 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 roles/etherpad/templates/update_etherpad diff --git a/roles/etherpad/tasks/main.yml b/roles/etherpad/tasks/main.yml index 185fe51..9575ce9 100644 --- a/roles/etherpad/tasks/main.yml +++ b/roles/etherpad/tasks/main.yml @@ -63,3 +63,15 @@ name: etherpad enabled: true state: started + +- name: Install script to update etherpad + ansible.builtin.template: + src: update_etherpad + dest: /usr/bin/update_etherpad + mode: "755" + +- name: Install daily crontab to update etherpad + ansible.builtin.cron: + special_time: daily + name: Update etherpad + job: /usr/bin/update_etherpad diff --git a/roles/etherpad/templates/update_etherpad b/roles/etherpad/templates/update_etherpad new file mode 100644 index 0000000..9268d5a --- /dev/null +++ b/roles/etherpad/templates/update_etherpad @@ -0,0 +1,12 @@ +#!/bin/sh + +cd {{ src_dir }}/etherpad +prev_commit="$(git status --oneline -n 1 | cut -c1-7)" +git pull +new_commit="$(git status --oneline -n 1 | cut -c1-7)" +if [ "$prev_commit" != "$new_commit" ] +then + pnpm install + pnpm run build:ui + rc-service etherpad restart +fi diff --git a/todo.txt b/todo.txt index 208ab0e..bba5a17 100644 --- a/todo.txt +++ b/todo.txt @@ -1,4 +1,3 @@ -Make etherpad self-updating Make dyndns self-updating Make cgit self-updating Make git-daemon self-updating -- cgit v1.2.3