summaryrefslogtreecommitdiff
path: root/roles
diff options
context:
space:
mode:
authorNick White <git@njw.name>2020-09-01 19:39:56 +0100
committerNick White <git@njw.name>2020-09-01 19:39:56 +0100
commit00afe20fac63f48fbe48ff0136949d779c0d5237 (patch)
tree5a8cb70f4bd7f14a86ae6618a70101da0b918806 /roles
parent51188ee4d4cd26db793cc82b6f054fd5c3575e16 (diff)
Ensure go modules are always used by the updatepipeline script
Diffstat (limited to 'roles')
-rw-r--r--roles/pipeliner/tasks/pipeline.yml29
1 files changed, 21 insertions, 8 deletions
diff --git a/roles/pipeliner/tasks/pipeline.yml b/roles/pipeliner/tasks/pipeline.yml
index 582e5de..9eaa5b9 100644
--- a/roles/pipeliner/tasks/pipeline.yml
+++ b/roles/pipeliner/tasks/pipeline.yml
@@ -21,23 +21,36 @@
default_release: stretch-backports
update_cache: yes
-# Do this manually rather than relying on go get so that step can
-# be skipped if nothing has been changed
+# Do this manually rather than relying on go get so that go get
+# with modules enabled can be run to do the build
- name: Get go repo
- git: dest=/home/{{ ansible_user }}/src/go/src/rescribe.xyz/{{ item }} repo=https://git.rescribe.xyz/{{ item }}
+ git:
+ dest: /home/{{ ansible_user }}/src/go/src/rescribe.xyz/{{ item }}
+ repo: https://git.rescribe.xyz/{{ item }}
+ force: yes
become: no
with_items:
- bookpipeline
- preproc
- utils
- register: gorepo
- name: Get and build bookpipeline and dependencies
- command: go get -u rescribe.xyz/bookpipeline/...
- environment:
- GOPATH: /home/{{ ansible_user }}/src/go
+ shell:
+ cmd: GOPATH=/home/{{ ansible_user }}/src/go GO111MODULE=on go get -u rescribe.xyz/bookpipeline/...
+ chdir: /home/{{ ansible_user }}/src/go/src/rescribe.xyz/bookpipeline
become: no
- when: gorepo.changed
+# command fails because of a strange error with environment, resulting in
+# 'go: unknown environment setting GO111MODULE=True'
+# so we're setting it from the shell instead.
+# we should be able to revert back to command once using a more recent
+# go version where GO111MODULE is not required.
+# command:
+# cmd: go get -u rescribe.xyz/bookpipeline/...
+# chdir: /home/{{ ansible_user }}/src/go/src/rescribe.xyz/bookpipeline
+# environment:
+# GOPATH: /home/{{ ansible_user }}/src/go
+# GO111MODULE: on
+# become: no
- name: Install bookpipeline binary
copy: