diff options
| author | Joe Carstairs <me@joeac.net> | 2026-08-26 08:48:58 +0100 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-08-26 08:49:14 +0100 |
| commit | 1837f2c9b1a00ce2d50ebb5f8c63032993a5d000 (patch) | |
| tree | ae6d55104d5506aa25c4b5e173fd7f49168662a4 | |
| parent | dcab47136092d056f1729f004b81e0093106852c (diff) | |
etherpad auto-updates
| -rw-r--r-- | roles/etherpad/tasks/main.yml | 12 | ||||
| -rw-r--r-- | roles/etherpad/templates/update_etherpad | 12 | ||||
| -rw-r--r-- | todo.txt | 1 |
3 files changed, 24 insertions, 1 deletions
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 @@ -1,4 +1,3 @@ -Make etherpad self-updating Make dyndns self-updating Make cgit self-updating Make git-daemon self-updating |
