nostr/build/tasks/main.yaml
changeset 217 e69a030975c4
parent 216 6c85835d4621
child 219 0faea2a7570f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nostr/build/tasks/main.yaml	Sat Jul 22 15:50:36 2023 -0500
@@ -0,0 +1,39 @@
+---
+
+- 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