src.nth.io/

summaryrefslogtreecommitdiff
path: root/pleroma/build
diff options
context:
space:
mode:
authorLuke Hoersten <[email protected]>2026-04-25 19:54:49 -0500
committerLuke Hoersten <[email protected]>2026-04-25 19:54:49 -0500
commit6a8cb5f10557733f1521035d57a191b12832d634 (patch)
tree159e102eb03c7c04e7f51844fd4da136b9185fdd /pleroma/build
parent5d5b976e379487e8b1eccc4fc96d5920a930ff0f (diff)
Build all roles from source with versioned artifacts
- Add pleroma/build role to compile from source (OTP binaries no longer published) - Install Elixir 1.18.3 manually on Ubuntu Noble (ships 1.14, needs 1.15+) - Standardize all build roles to produce versioned .tar.gz artifacts - Add version defaults to all server roles (bin, dendrite, nostr/relayer) - Switch server roles from get_url to unarchive for .tar.gz installs - Add build_srv_dir variable to all build roles - Deploy pleroma styles.json so custom FE themes appear in picker - Fix pleroma OTP install: version check, root ownership, auto-cleanup old releases - Fix pleroma config: log level :warn -> :warning, remove availableStyles - Add wait_for grafana readiness before dashboard install - Set minecraft ops changed_when: false
Diffstat (limited to 'pleroma/build')
-rw-r--r--pleroma/build/defaults/main.yaml9
-rw-r--r--pleroma/build/tasks/main.yaml88
2 files changed, 97 insertions, 0 deletions
diff --git a/pleroma/build/defaults/main.yaml b/pleroma/build/defaults/main.yaml
new file mode 100644
index 0000000..2d16436
--- /dev/null
+++ b/pleroma/build/defaults/main.yaml
@@ -0,0 +1,9 @@
+---
+
+pleroma_version: "2.10.0"
+pleroma_elixir_version: "1.18.3"
+pleroma_erlang_otp_version: "25"
+# https://git.pleroma.social/pleroma/pleroma/releases
+pleroma_tar: "https://git.pleroma.social/pleroma/pleroma/archive/v{{pleroma_version}}.tar.gz"
+pleroma_build_dir: "/tmp/pleroma"
+pleroma_srv_dir: "{{build_srv_dir}}"
diff --git a/pleroma/build/tasks/main.yaml b/pleroma/build/tasks/main.yaml
new file mode 100644
index 0000000..ae3e35d
--- /dev/null
+++ b/pleroma/build/tasks/main.yaml
@@ -0,0 +1,88 @@
+---
+
+- name: install elixir build dependencies
+ become: yes
+ apt:
+ name:
+ - erlang
+ - erlang-dev
+ - build-essential
+ - cmake
+ - libmagic-dev
+ - libvips-dev
+
+# TODO: Ubuntu Noble (24.04) only ships Elixir 1.14, which is too old for Pleroma.
+# When the next Ubuntu LTS (26.04) is available, check if elixir >=1.15 is in the
+# official repos and replace the two tasks below with a simple apt install.
+- name: download elixir release
+ become: yes
+ get_url:
+ url: "https://github.com/elixir-lang/elixir/releases/download/v{{pleroma_elixir_version}}/elixir-otp-{{pleroma_erlang_otp_version}}.zip"
+ dest: "/tmp/elixir-{{pleroma_elixir_version}}.zip"
+ force: false
+
+- name: install elixir
+ become: yes
+ unarchive:
+ remote_src: yes
+ src: "/tmp/elixir-{{pleroma_elixir_version}}.zip"
+ dest: "/usr/local"
+ creates: "/usr/local/bin/elixir"
+
+- name: install hex package manager
+ command: mix local.hex --force
+ changed_when: false
+
+- name: install rebar
+ command: mix local.rebar --force
+ changed_when: false
+
+- name: unarchive pleroma source
+ unarchive:
+ remote_src: yes
+ src: "{{pleroma_tar}}"
+ dest: "/tmp/"
+ creates: "{{pleroma_build_dir}}"
+
+- name: check if pleroma release exists
+ stat:
+ path: "{{pleroma_srv_dir}}/pleroma-{{pleroma_version}}.tar.gz"
+ register: build_file
+
+- name: fetch mix dependencies
+ command: mix deps.get --only prod
+ args:
+ chdir: "{{pleroma_build_dir}}"
+ environment:
+ MIX_ENV: prod
+ when: not build_file.stat.exists
+
+- name: build pleroma release
+ command: mix release
+ args:
+ chdir: "{{pleroma_build_dir}}"
+ environment:
+ MIX_ENV: prod
+ when: not build_file.stat.exists
+
+- name: create build server dir
+ become: yes
+ file:
+ path: "{{pleroma_srv_dir}}"
+ mode: "0755"
+ state: "directory"
+
+- name: copy release to staging directory
+ copy:
+ remote_src: yes
+ src: "{{pleroma_build_dir}}/_build/prod/rel/pleroma/"
+ dest: "/tmp/release/"
+ when: not build_file.stat.exists
+
+- name: create gz archive of pleroma release
+ become: yes
+ archive:
+ path: "/tmp/release"
+ dest: "{{pleroma_srv_dir}}/pleroma-{{pleroma_version}}.tar.gz"
+ format: "gz"
+ when: not build_file.stat.exists