-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-duplicacy.yml
45 lines (39 loc) · 1.43 KB
/
install-duplicacy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
- hosts: utat
become: no
gather_facts: yes
vars:
- working_dir: "{{ ansible_env.HOME }}/go-duplicacy"
- go_location: "/usr/local/go/bin/go"
environment:
GO111MODULE: "off"
GOPATH: '/{{ working_dir }}'
tasks:
# Since the current build of Duplicacy does not have an important gdrive feature
# we must build from source. But it's not maintained well, so that's tricky
# Sauce: https://github.com/gilbertchen/duplicacy/issues/618
# https://github.com/gilbertchen/duplicacy/wiki/Installation
# https://stackoverflow.com/questions/66284870/go-get-not-downloading-to-src-folder
# This will fail, but this is intentional.
- name: Install duplicacy
command: "{{ go_location }} get -v github.com/gilbertchen/duplicacy/..."
ignore_errors: yes
no_log: yes
- name: Update duplicacy deps
command:
cmd: dep ensure -add github.com/ncw/swift@v1.0.53
chdir: "{{ working_dir }}/src/github.com/gilbertchen/duplicacy"
ignore_errors: yes
- name: Build duplicacy
command: "{{ go_location }} install github.com/gilbertchen/duplicacy/duplicacy"
- name: Install duplicacy, for real
copy:
remote_src: true
src: "{{ working_dir }}/bin/duplicacy"
dest: /usr/local/bin/duplicacy
mode: a+x
become: yes
- name: Remove working directory
file:
path: "{{ working_dir}}"
state: absent