From 0dfd81ca1696053b366a39cab02e54205a09fb20 Mon Sep 17 00:00:00 2001 From: Luke Hoersten Date: Sun, 26 Jul 2026 16:46:21 -0500 Subject: build roles: create build_work_dir and redirect caches per-role 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. --- mattertimesync/build/tasks/main.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'mattertimesync/build') diff --git a/mattertimesync/build/tasks/main.yaml b/mattertimesync/build/tasks/main.yaml index e846f9c..c586e01 100644 --- a/mattertimesync/build/tasks/main.yaml +++ b/mattertimesync/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: unarchive mattertimesync source unarchive: remote_src: yes @@ -16,6 +25,9 @@ command: "npm ci" args: chdir: "{{mattertimesync_build_dir}}" + # Keep the npm cache on build_work_dir (the SSD) instead of the SD card. + environment: + npm_config_cache: "{{build_work_dir}}/.npm" when: not build_file.stat.exists - name: bundle mattertimesync @@ -23,6 +35,8 @@ args: chdir: "{{mattertimesync_build_dir}}" creates: "{{mattertimesync_build_dir}}/mattertimesync.mjs" + environment: + npm_config_cache: "{{build_work_dir}}/.npm" when: not build_file.stat.exists - name: create build server dir -- cgit v1.2.3