summaryrefslogtreecommitdiffstats
path: root/roles/wiki-publish/tasks
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2022-10-16 18:11:09 -0400
committerSacha Chua <sacha@sachachua.com>2022-10-16 18:11:09 -0400
commit12c465a8f6e127a599b0477094552fc90c7e2ce0 (patch)
tree81abef4c2a2d0230ca403eed1133815f2e37a740 /roles/wiki-publish/tasks
parent84ccb907a14bd8bd06afec7b5ac836fa7a0883f6 (diff)
parent54af5163644ef58a641e86288c7af8653970a319 (diff)
downloademacsconf-ansible-12c465a8f6e127a599b0477094552fc90c7e2ce0.tar.xz
emacsconf-ansible-12c465a8f6e127a599b0477094552fc90c7e2ce0.zip
Merge branch 'main' of git.emacsconf.org:pub/emacsconf-ansible into main
Diffstat (limited to 'roles/wiki-publish/tasks')
-rw-r--r--roles/wiki-publish/tasks/main.yml71
1 files changed, 71 insertions, 0 deletions
diff --git a/roles/wiki-publish/tasks/main.yml b/roles/wiki-publish/tasks/main.yml
new file mode 100644
index 0000000..897cecc
--- /dev/null
+++ b/roles/wiki-publish/tasks/main.yml
@@ -0,0 +1,71 @@
+---
+- name: Set up SSH directory
+ ansible.builtin.file:
+ path: /home/ikiwiki/.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
+ mode: '0600'
+ owner: 'ikiwiki'
+- name: Set up packages
+ become: yes
+ block:
+ # This repository is currently not working
+ # - name: Add snapshot repository
+ # ansible.builtin.apt_repository:
+ # repo: deb http://emacs.ganneff.de/ buster main
+ - name: Remove old package
+ ansible.builtin.apt:
+ name: emacs
+ state: absent
+ - name: Install Emacs snapshot
+ ansible.builtin.apt:
+ name: emacs-snapshot-nox
+ state: present
+- name: Set up Emacs configuration for non-interactive publishing
+ become: true
+ become_user: "{{ emacsconf_publish_user }}"
+ template:
+ src: emacsconf-config.el
+ dest: "{{ emacs_config_dir }}/emacsconf-config.el"
+- name: Check if Emacs base configuration already exists
+ become: true
+ become_user: "{{ emacsconf_publish_user }}"
+ lineinfile:
+ dest: "{{ emacs_config_dir }}/init.el"
+ state: present
+ regexp: "emacsconf-config"
+ line: "(load-file \"emacsconf-config.el\")"
+- name: Set up or update repositories
+ become: false
+ tags: publish
+ block:
+ - name: Check out wiki repository
+ ansible.builtin.git:
+ repo: git://git.emacsconf.org/emacsconf-wiki
+ dest: "{{ emacsconf_edit_wiki_dir }}"
+ - name: Check out emacsconf-el
+ ansible.builtin.git:
+ repo: git@git.emacsconf.org:pub/emacsconf-el
+ dest: "{{ emacsconf_el_dir }}"
+ register: elisp
+ - name: Check out emacsconf-2022-private
+ ansible.builtin.git:
+ repo: git@git.emacsconf.org:emacsconf-2022-private
+ dest: "{{ emacsconf_private_dir }}"
+ register: private
+- name: Publish
+ tags: publish
+ block:
+ - name: Publish the schedule
+ command: emacs -l "{{ emacsconf_config_dir }}/emacsconf-config.el" --batch --exec '(emacsconf-generate-main-schedule)'
+ when: (force_publish|d(false)) or ((private.changed or elisp.changed) and slug is not defined)
+ - name: Update a specific talk's nav page
+ tags: publish-talk
+ command: emacs -l "{{ emacsconf_config_dir }}/emacsconf-config.el" --batch --exec '(emacsconf-with-talk-heading "{{ slug }}" (emacsconf-update-talk))'
+ when: slug is defined
+ - name: Commit the wiki and push
+ shell: cd {{ emacsconf_edit_wiki_dir }}; git commit -m 'Update from ansible' -a; git push