Skip to content

Commit

Permalink
Use custom installation golang first (apache#48)
Browse files Browse the repository at this point in the history
* use custom installation golang first

* remove golang existence check

* move /usr/local/go/bin to the top of PATH env
  • Loading branch information
Zhuli authored and kiwik committed Feb 7, 2018
1 parent aee7d2d commit 527c7e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
10 changes: 1 addition & 9 deletions roles/install-golang/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
---
- name: Register the current Go version
command: /usr/local/go/bin/go version
ignore_errors: yes
register: go_version

- name: Download the Go tarball
get_url:
url: '{{ go_download_location }}'
dest: '/usr/local/src/{{ go_tarball }}'
when: go_version|failed

- name: Remove old installation of Go
file:
path: /usr/local/go
state: absent
when: go_version|failed

- name: Extract the Go tarball if Go is not yet installed
- name: Extract the Go tarball to place
unarchive:
src: '/usr/local/src/{{ go_tarball }}'
dest: /usr/local
remote_src: yes
when: go_version|failed
2 changes: 1 addition & 1 deletion zuul.d/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
vars:
golang_env:
GOPATH: '{{ ansible_user_dir }}'
PATH: '{{ ansible_env.PATH }}:/usr/local/go/bin:{{ ansible_user_dir }}/bin'
PATH: '/usr/local/go/bin:{{ ansible_user_dir }}/bin:{{ ansible_env.PATH }}'
TEST_RESULTS_TXT: '{{ ansible_user_dir }}/workspace/test_results.txt'
TEST_RESULTS_XML: '{{ ansible_user_dir }}/workspace/test_results.xml'
TEST_RESULTS_HTML: '{{ ansible_user_dir }}/workspace/test_results.html'
Expand Down

0 comments on commit 527c7e0

Please sign in to comment.