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:
Pig Monkey 2016-03-31 11:17:33 -07:00
parent d71a93d610
commit dd7d5cf206
4 changed files with 40 additions and 0 deletions

View file

@ -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"

View file

@ -0,0 +1,3 @@
---
dependencies:
- { role: golang }

View 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

View 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