summaryrefslogtreecommitdiff
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
parent51188ee4d4cd26db793cc82b6f054fd5c3575e16 (diff)
Ensure go modules are always used by the updatepipeline script
-rw-r--r--README2
-rw-r--r--roles/pipeliner/tasks/pipeline.yml29
2 files changed, 22 insertions, 9 deletions
diff --git a/README b/README
index bf36167..6d2b461 100644
--- a/README
+++ b/README
@@ -20,7 +20,7 @@ To create a fresh pipeliner image:
host_vars/pipelineami
- Run ansible:
- ansible-playbook -i hosts pipeliner.yml
+ ansible-playbook --ask-vault-pass -i hosts pipeliner.yml
- Get names of old images for reference:
aws ec2 describe-images --owners self
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: