lnurld/build/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Sat, 22 Jul 2023 23:27:09 -0500
changeset 218 1db4800bc4f5
parent 217 nostr/build/tasks/main.yaml@e69a030975c4
permissions -rw-r--r--
Got lnurld running.

---

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

- 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