summaryrefslogtreecommitdiffstats
path: root/roles/wiki-publish/tasks
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2022-10-17 17:44:06 -0400
committerSacha Chua <sacha@sachachua.com>2022-10-17 17:44:06 -0400
commit7671b51616a25fa6cff9c26fe65d5f703ff94e21 (patch)
treeb85c0e39c1ca65cbf2d9fb4d0e534acd6861083b /roles/wiki-publish/tasks
parent656e440054f43fc09050ba13e29d4eaaf355fcf5 (diff)
downloademacsconf-ansible-7671b51616a25fa6cff9c26fe65d5f703ff94e21.tar.xz
emacsconf-ansible-7671b51616a25fa6cff9c26fe65d5f703ff94e21.zip
Get wiki role to push updates to the right place in docker
Ikiwiki has this three-repo setup with post-update hooks
Diffstat (limited to '')
-rw-r--r--roles/wiki-publish/tasks/main.yml22
1 files changed, 18 insertions, 4 deletions
diff --git a/roles/wiki-publish/tasks/main.yml b/roles/wiki-publish/tasks/main.yml
index 897cecc..960aa01 100644
--- a/roles/wiki-publish/tasks/main.yml
+++ b/roles/wiki-publish/tasks/main.yml
@@ -1,17 +1,18 @@
---
- name: Set up SSH directory
ansible.builtin.file:
- path: /home/ikiwiki/.ssh
+ path: "/home/{{ emacsconf_publish_user }}/.ssh"
state: directory
mode: '0700'
- name: Install SSH key for EmacsConf wiki
ansible.builtin.get_url:
url: https://emacsconf.org/id_rsa_anon_git_emacsconf
- dest: /home/ikiwiki/.ssh/id_rsa_anon_git_emacsconf
+ dest: "/home/{{ emacsconf_publish_user }}/.ssh/id_rsa_anon_git_emacsconf"
mode: '0600'
- owner: 'ikiwiki'
+ owner: "{{ emacsconf_publish_user }}"
- name: Set up packages
become: yes
+ when: emacs_package and emacs_package != "emacs"
block:
# This repository is currently not working
# - name: Add snapshot repository
@@ -23,7 +24,7 @@
state: absent
- name: Install Emacs snapshot
ansible.builtin.apt:
- name: emacs-snapshot-nox
+ name: "{{ emacs_package }}"
state: present
- name: Set up Emacs configuration for non-interactive publishing
become: true
@@ -47,16 +48,29 @@
ansible.builtin.git:
repo: git://git.emacsconf.org/emacsconf-wiki
dest: "{{ emacsconf_edit_wiki_dir }}"
+ register: wiki_clone
+ failed_when:
+ - wiki_clone.failed
+ - not 'Local modifications exist in repository' in wiki_clone.msg
+ - not 'Failed to checkout branch' in wiki_clone.msg
- name: Check out emacsconf-el
ansible.builtin.git:
repo: git@git.emacsconf.org:pub/emacsconf-el
dest: "{{ emacsconf_el_dir }}"
register: elisp
+ failed_when:
+ - elisp.failed
+ - not 'Local modifications exist in repository' in elisp.msg
+ - not 'Failed to checkout branch' in elisp.msg
- name: Check out emacsconf-2022-private
ansible.builtin.git:
repo: git@git.emacsconf.org:emacsconf-2022-private
dest: "{{ emacsconf_private_dir }}"
register: private
+ failed_when:
+ - private.failed
+ - not 'Local modifications exist in repository' in private.msg
+ - not 'Failed to checkout branch' in private.msg
- name: Publish
tags: publish
block: