mirror of
https://github.com/pigmonkey/spark.git
synced 2026-01-23 02:24:09 +00:00
install cli53
I don't know if this is the best way to handle building go packages. Basically the idea is to treat GOPATH like python virtualenvs. A different one for each thing we install. I'm open to other ideas (or just moving the root to someplace other than /usr/local/go).
This commit is contained in:
parent
d71a93d610
commit
dd7d5cf206
4 changed files with 40 additions and 0 deletions
|
|
@ -50,6 +50,7 @@
|
|||
- { role: formd, tags: ['formd'] }
|
||||
- { role: postgresql, tags: ['postgresql'] }
|
||||
- { role: calibre, tags: ['calibre'] }
|
||||
- { role: cli53, tags: ['cli53'] }
|
||||
vars_prompt:
|
||||
- name: user_password
|
||||
prompt: "Enter desired user password"
|
||||
|
|
|
|||
3
roles/cli53/meta/main.yml
Normal file
3
roles/cli53/meta/main.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
dependencies:
|
||||
- { role: golang }
|
||||
24
roles/cli53/tasks/main.yml
Normal file
24
roles/cli53/tasks/main.yml
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
- name: Download cli53
|
||||
command: go get github.com/barnybug/cli53
|
||||
creates=/usr/local/go/cli53
|
||||
environment:
|
||||
GO15VENDOREXPERIMENT: 1
|
||||
GOPATH: /usr/local/go/cli53
|
||||
become: yes
|
||||
become_user: "{{ user.name }}"
|
||||
|
||||
- name: Make cli53
|
||||
command: make install
|
||||
chdir=/usr/local/go/cli53/src/github.com/barnybug/cli53
|
||||
creates=/usr/local/go/cli53/bin/cli53
|
||||
environment:
|
||||
GO15VENDOREXPERIMENT: 1
|
||||
GOPATH: /usr/local/go/cli53
|
||||
become: yes
|
||||
become_user: "{{ user.name }}"
|
||||
|
||||
- name: Link cli53 to bin
|
||||
file: src=/usr/local/go/cli53/bin/cli53
|
||||
dest=/usr/local/bin/cli53
|
||||
state=link
|
||||
12
roles/golang/tasks/main.yml
Normal file
12
roles/golang/tasks/main.yml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
- name: Install go
|
||||
pacman: name=go state=present
|
||||
|
||||
- name: Create system go group
|
||||
group: name=golang state=present
|
||||
|
||||
- name: Add user to system golang group
|
||||
user: name={{ user.name }} groups=golang append=yes
|
||||
|
||||
- name: Create system go dir
|
||||
file: path=/usr/local/go state=directory group=golang mode=0775
|
||||
Loading…
Add table
Add a link
Reference in a new issue