summaryrefslogtreecommitdiffstats
path: root/roles/wiki-publish
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2022-10-29 07:33:39 -0400
committerSacha Chua <sacha@sachachua.com>2022-10-29 07:33:39 -0400
commita6a373410bde6918f27992ff967660c0541f810a (patch)
treeab8fbd6a5e12f065a7af82027b98df818dfb9603 /roles/wiki-publish
parentbff9ceae7f42723f939f620f9ef9faebca966742 (diff)
downloademacsconf-ansible-a6a373410bde6918f27992ff967660c0541f810a.tar.xz
emacsconf-ansible-a6a373410bde6918f27992ff967660c0541f810a.zip
media, wiki-publish, caption updates
* common-playbook.yml: Start moving publishing setup to res * group_vars/all.yml: New common variables. * inventory.yml (prod): Number of threads, new hosts * roles/caption/templates/process-captions.py: Add mp4, try to figure out why script was failing, simplify * roles/media/tasks/main.yml: New role for setting up media.emacsconf.org for this year * roles/prerec/templates/reencode.sh: Keep a copy of zaeph's script * roles/stream/defaults/main.yml: Add more variables * roles/stream: Restreaming lowres * roles/wiki-publish/tasks/emacs.yml: Build Emacs from source
Diffstat (limited to '')
-rw-r--r--roles/wiki-publish/defaults/main.yml13
-rw-r--r--roles/wiki-publish/tasks/emacs.yml38
-rw-r--r--roles/wiki-publish/tasks/main.yml53
3 files changed, 76 insertions, 28 deletions
diff --git a/roles/wiki-publish/defaults/main.yml b/roles/wiki-publish/defaults/main.yml
index 863003f..4de7445 100644
--- a/roles/wiki-publish/defaults/main.yml
+++ b/roles/wiki-publish/defaults/main.yml
@@ -1,8 +1,9 @@
-emacsconf_year: 2022
emacsconf_org_file: "{{ emacsconf_private_dir }}/conf.org"
emacsconf_publishing_phase: schedule
-emacsconf_el_dir: ~/emacsconf-el
-emacsconf_edit_wiki_dir: ~/emacsconf-wiki
-emacsconf_private_dir: ~/emacsconf-2022-private
-emacs_config_dir: ~/.emacs.d
-emacs_package: emacs-snapshot-nox
+emacsconf_el_dir: ~{{ emacsconf_user }}/emacsconf-el
+emacsconf_edit_wiki_dir: ~{{ emacsconf_user }}/emacsconf-wiki
+emacsconf_private_dir: ~{{ emacsconf_user }}/emacsconf-2022-private
+emacs_config_dir: ~{{ emacsconf_user }}/.emacs.d
+emacs_version: 28.2
+emacs_build_parent: /usr/src/emacs
+emacs_build_dir: "{{ emacs_build_parent }}/emacs-{{ emacs_version }}"
diff --git a/roles/wiki-publish/tasks/emacs.yml b/roles/wiki-publish/tasks/emacs.yml
new file mode 100644
index 0000000..8d75979
--- /dev/null
+++ b/roles/wiki-publish/tasks/emacs.yml
@@ -0,0 +1,38 @@
+- name: Install dependencies
+ apt:
+ name:
+ - build-essential
+ - libncurses5-dev
+ - git
+ - gnutls-bin
+ - pkg-config
+ - libjansson-dev
+ - libgnutls28-dev
+ - automake
+ - texinfo
+ state: present
+- name: Create directory
+ file:
+ path: "{{ emacs_build_parent }}"
+ state: directory
+- name: Download Emacs
+ unarchive:
+ src: https://ftp.gnu.org/gnu/emacs/emacs-{{emacs_version}}.tar.gz
+ remote_src: yes
+ dest: "{{ emacs_build_parent }}"
+ creates: "{{ emacs_build_dir }}"
+- name: Configure
+ command: ./configure --with-x-toolkit=no
+ args:
+ chdir: "{{ emacs_build_dir }}"
+ creates: '{{ emacs_build_dir }}/Makefile'
+- name: Build
+ command: make -j{{ cpus }}
+ args:
+ chdir: "{{ emacs_build_dir }}"
+ creates: '{{ emacs_build_dir }}/src/emacs'
+- name: Install
+ command: make install
+ args:
+ chdir: "{{ emacs_build_dir }}"
+ creates: '/usr/local/bin/emacs'
diff --git a/roles/wiki-publish/tasks/main.yml b/roles/wiki-publish/tasks/main.yml
index 960aa01..28566a5 100644
--- a/roles/wiki-publish/tasks/main.yml
+++ b/roles/wiki-publish/tasks/main.yml
@@ -1,45 +1,44 @@
---
- name: Set up SSH directory
ansible.builtin.file:
- path: "/home/{{ emacsconf_publish_user }}/.ssh"
+ path: "/home/{{ emacsconf_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/{{ emacsconf_publish_user }}/.ssh/id_rsa_anon_git_emacsconf"
+ dest: "/home/{{ emacsconf_user }}/.ssh/id_rsa_anon_git_emacsconf"
mode: '0600'
- 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
- # 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_package }}"
- state: present
+- name: Install the SSH key for orga
+ template:
+ src: id_rsa
+ dest: "/home/{{ emacsconf_user }}/.ssh/id_rsa"
+ mode: '0600'
+- name: Change ownership of SSH directory
+ file:
+ path: "/home/{{ emacsconf_user }}/.ssh"
+ recurse: true
+ owner: "{{ emacsconf_user }}"
+
+- name: Set up Emacs
+ include: emacs.yml
+- name: Ensure configuration directory exists
+ file:
+ path: "{{ emacs_config_dir }}"
+ state: directory
- 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\")"
+ create: yes
- name: Set up or update repositories
become: false
tags: publish
@@ -71,6 +70,16 @@
- private.failed
- not 'Local modifications exist in repository' in private.msg
- not 'Failed to checkout branch' in private.msg
+- name: Change ownership
+ file:
+ path: "{{ item }}"
+ owner: "{{ emacsconf_user }}"
+ recurse: true
+ with_items:
+ - "{{ emacsconf_config_dir }}"
+ - "{{ emacsconf_el_dir }}"
+ - "{{ emacsconf_private_dir }}"
+ - "{{ emacsconf_edit_wiki_dir }}"
- name: Publish
tags: publish
block: