src.nth.io/

summaryrefslogtreecommitdiff
path: root/lnurld/build/tasks/main.yaml
blob: 3dd30cc9c5eef1d263af6133c4b5a5af943ae77b (plain)
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
45
---

- name: install golang
  become: yes
  apt: name="golang-1.21-go"

- name: link go bin
  become: yes
  file:
    src: "/usr/lib/go-1.21/bin/go"
    dest: "/usr/bin/go"
    state: "link"
    mode: "0755"

- name: git checkout lnurld
  git:
    repo: "{{lnurld_git}}"
    dest: "{{lnurld_build_dir}}"
    version: "{{lnurld_version}}"

- name: check if build exists
  stat:
    path: "{{lnurld_srv_dir}}/lnurld-{{lnurld_version}}.tar.gz"
  register: build_file

- name: build
  command: "go build"
  args:
    chdir: "{{lnurld_build_dir}}"
  when: not build_file.stat.exists

- name: create build server dir
  become: yes
  file:
    path: "{{lnurld_srv_dir}}"
    mode: "0755"
    state: "directory"

- name: create gz archive of lnurld
  become: yes
  archive:
    path: "{{lnurld_build_dir}}/lnurld"
    dest: "{{lnurld_srv_dir}}/lnurld-{{lnurld_version}}.tar.gz"
    format: "gz"
  when: not build_file.stat.exists