dendrite/build/tasks/main.yaml
changeset 216 6c85835d4621
parent 215 dd52907adff9
child 224 25e44d8440d4
--- a/dendrite/build/tasks/main.yaml	Fri Jul 21 15:14:24 2023 -0500
+++ b/dendrite/build/tasks/main.yaml	Sat Jul 22 15:50:07 2023 -0500
@@ -1,8 +1,8 @@
 ---
 
-- name: snap install golang
+- name: install golang
   become: yes
-  snap: name="go" classic="yes"
+  apt: name="golang-go"
 
 - name: unarchive dendrite
   unarchive:
@@ -11,13 +11,39 @@
     dest: "/tmp/"
     creates: "{{dendrite_build_dir}}"
 
+- name: create build dir
+  file:
+    path: "{{dendrite_build_dir}}/bin"
+    mode: "0755"
+    state: "directory"
+
 - name: check if dendrite build exists
   stat:
-    path: "{{dendrite_build_dir}}/bin"
+    path: "{{dendrite_build_dir}}/bin/dendrite"
   register: build_file
 
 - name: build dendrite
-  command: "{{dendrite_build_dir}}/build.sh"
+  command: "go build -o bin/ ./cmd/..."
   args:
     chdir: "{{dendrite_build_dir}}"
   when: not build_file.stat.exists
+
+- name: create build server dir
+  become: yes
+  file:
+    path: "{{dendrite_srv_dir}}"
+    mode: "0755"
+    state: "directory"
+  when: not build_file.stat.exists
+
+- name: create a gz archive of dendrite bins
+  become: yes
+  archive:
+    path: "{{dendrite_build_dir}}/bin/*"
+    exclude_path:
+      - "{{dendrite_build_dir}}/bin/dendrite-demo-pinecone"
+      - "{{dendrite_build_dir}}/bin/dendrite-demo-yggdrasil"
+      - "{{dendrite_build_dir}}/bin/furl"
+    dest: "{{dendrite_srv_dir}}/dendrite.tar.gz"
+    format: "gz"
+  when: not build_file.stat.exists