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

---

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

- name: unarchive nostr relayer
  unarchive:
    remote_src: yes
    src: "{{relayer_tar}}"
    dest: "/tmp/"
    creates: "{{relayer_build_dir}}"

- name: check if relayer build exists
  stat:
    path: "{{relayer_build_dir}}/whitelisted/whitelisted"
  register: build_file

- name: build relayer
  command: "go build"
  args:
    chdir: "{{relayer_build_dir}}/whitelisted"
  when: not build_file.stat.exists

- name: create build server dir
  become: yes
  file:
    path: "{{relayer_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: "{{relayer_build_dir}}/whitelisted/whitelisted"
    dest: "{{relayer_srv_dir}}/nostr-relayer-whitelisted"
  when: not build_file.stat.exists