diff options
| author | Luke Hoersten <[email protected]> | 2026-07-26 16:46:21 -0500 |
|---|---|---|
| committer | Luke Hoersten <[email protected]> | 2026-07-26 16:46:21 -0500 |
| commit | f0d085279b2b5310c6f175d01f0d20afdad85e0e (patch) | |
| tree | bed8cc66a88c165f542783492ce0aafdcd563e22 /lnurld/build/tasks/main.yaml | |
| parent | 45f9acddf48de0e6e1e05aaf4a37e77552c5324c (diff) | |
lnurld/build: create build_work_dir and redirect Go caches
Create the work dir and set GOPATH/GOCACHE/GOMODCACHE on the build task, so the
role is self-contained rather than relying on the playbook's environment.
Diffstat (limited to 'lnurld/build/tasks/main.yaml')
| -rw-r--r-- | lnurld/build/tasks/main.yaml | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lnurld/build/tasks/main.yaml b/lnurld/build/tasks/main.yaml index 4fc685c..5f40b93 100644 --- a/lnurld/build/tasks/main.yaml +++ b/lnurld/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" @@ -27,6 +36,11 @@ command: "go build" args: chdir: "{{lnurld_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 |
