src.nth.io/

summaryrefslogtreecommitdiff
path: root/dendrite/build
diff options
context:
space:
mode:
authorLuke Hoersten <[email protected]>2026-07-26 16:46:21 -0500
committerLuke Hoersten <[email protected]>2026-07-26 16:46:21 -0500
commit0dfd81ca1696053b366a39cab02e54205a09fb20 (patch)
treecd04171767d232f4a1840ee7abac2b8ded3fde91 /dendrite/build
parent28c1fc8ea39f0fdb244f08f386ed81a2c68c0f5c (diff)
build roles: create build_work_dir and redirect caches per-roleHEADmain
Each build role now creates build_work_dir itself and sets its own toolchain's cache env (GOPATH/GOCACHE/GOMODCACHE, CARGO_HOME, npm cache, MIX/HEX) on its build tasks, so the roles are self-contained instead of relying on a play-level environment and pre_task.
Diffstat (limited to 'dendrite/build')
-rw-r--r--dendrite/build/tasks/main.yaml14
1 files changed, 14 insertions, 0 deletions
diff --git a/dendrite/build/tasks/main.yaml b/dendrite/build/tasks/main.yaml
index dff7bdb..10f2e12 100644
--- a/dendrite/build/tasks/main.yaml
+++ b/dendrite/build/tasks/main.yaml
@@ -1,5 +1,14 @@
---
+- name: ensure build work dir exists
+ become: yes
+ file:
+ path: "{{build_work_dir}}"
+ state: "directory"
+ owner: "{{ansible_user}}"
+ group: "{{ansible_user}}"
+ mode: "0755"
+
- name: install golang
become: yes
apt: name="golang-1.21-go"
@@ -34,6 +43,11 @@
command: "go build -o bin/ ./cmd/..."
args:
chdir: "{{dendrite_build_dir}}"
+ # Keep the Go caches on build_work_dir (the SSD) instead of the SD card.
+ environment:
+ GOPATH: "{{build_work_dir}}/.go"
+ GOCACHE: "{{build_work_dir}}/.go-cache"
+ GOMODCACHE: "{{build_work_dir}}/.go-mod"
when: not build_file.stat.exists
- name: create build server dir