lnurld/build/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Mon, 12 Feb 2024 17:29:25 -0600
changeset 33 8ef7fcebf4b1
parent 32 500a32d1f026
permissions -rw-r--r--
Version updates

---

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

- name: check if build exists
  stat:
    path: "{{lnurld_build_dir}}/lnurld"
  register: build_file

- name: build
  command: "go build"
  args:
    chdir: "/tmp/lnurld/"
  when: not build_file.stat.exists

- name: create build server dir
  become: yes
  file:
    path: "{{lnurld_srv_dir}}"
    mode: "0755"
    state: "directory"
  when: not build_file.stat.exists

- name: copy bin to build server dir
  become: yes
  copy:
    remote_src: yes
    src: "{{lnurld_build_dir}}/lnurld"
    dest: "{{lnurld_srv_dir}}/lnurld"
  when: not build_file.stat.exists