5 - name: Create go directories
7 path: "{{ global_cache_dir }}/{{ inventory_hostname }}/{{ item }}"
9 with_items: [ gopath, gocache ]
11 - name: Clone necessary git repositories
13 repo: https://github.com/realraum/{{ item }}.git
14 dest: "{{ global_cache_dir }}/{{ inventory_hostname }}/{{ item }}"
16 with_items: [ door_and_sensors ]
18 - name: Download dependencies
19 command: go get -d ./...
21 chdir: "{{ global_cache_dir }}/{{ inventory_hostname }}/door_and_sensors/{{ item }}"
23 GOCACHE: "{{ global_cache_dir }}/{{ inventory_hostname }}/gocache"
24 GOPATH: "{{ global_cache_dir }}/{{ inventory_hostname }}/gopath"
25 with_items: [ door_client, door_daemon, update-keys ]
27 - name: Cross-compile Go binaries
28 command: go build -ldflags "-s"
30 chdir: "{{ global_cache_dir }}/{{ inventory_hostname }}/door_and_sensors/{{ item }}"
32 GOCACHE: "{{ global_cache_dir }}/{{ inventory_hostname }}/gocache"
33 GOPATH: "{{ global_cache_dir }}/{{ inventory_hostname }}/gopath"
38 with_items: [ door_client, door_daemon, update-keys ]
42 delegate_to: localhost