dendrite/build/tasks/main.yaml
changeset 216 6c85835d4621
parent 215 dd52907adff9
child 224 25e44d8440d4
equal deleted inserted replaced
215:dd52907adff9 216:6c85835d4621
     1 ---
     1 ---
     2 
     2 
     3 - name: snap install golang
     3 - name: install golang
     4   become: yes
     4   become: yes
     5   snap: name="go" classic="yes"
     5   apt: name="golang-go"
     6 
     6 
     7 - name: unarchive dendrite
     7 - name: unarchive dendrite
     8   unarchive:
     8   unarchive:
     9     remote_src: yes
     9     remote_src: yes
    10     src: "{{dendrite_tar}}"
    10     src: "{{dendrite_tar}}"
    11     dest: "/tmp/"
    11     dest: "/tmp/"
    12     creates: "{{dendrite_build_dir}}"
    12     creates: "{{dendrite_build_dir}}"
    13 
    13 
       
    14 - name: create build dir
       
    15   file:
       
    16     path: "{{dendrite_build_dir}}/bin"
       
    17     mode: "0755"
       
    18     state: "directory"
       
    19 
    14 - name: check if dendrite build exists
    20 - name: check if dendrite build exists
    15   stat:
    21   stat:
    16     path: "{{dendrite_build_dir}}/bin"
    22     path: "{{dendrite_build_dir}}/bin/dendrite"
    17   register: build_file
    23   register: build_file
    18 
    24 
    19 - name: build dendrite
    25 - name: build dendrite
    20   command: "{{dendrite_build_dir}}/build.sh"
    26   command: "go build -o bin/ ./cmd/..."
    21   args:
    27   args:
    22     chdir: "{{dendrite_build_dir}}"
    28     chdir: "{{dendrite_build_dir}}"
    23   when: not build_file.stat.exists
    29   when: not build_file.stat.exists
       
    30 
       
    31 - name: create build server dir
       
    32   become: yes
       
    33   file:
       
    34     path: "{{dendrite_srv_dir}}"
       
    35     mode: "0755"
       
    36     state: "directory"
       
    37   when: not build_file.stat.exists
       
    38 
       
    39 - name: create a gz archive of dendrite bins
       
    40   become: yes
       
    41   archive:
       
    42     path: "{{dendrite_build_dir}}/bin/*"
       
    43     exclude_path:
       
    44       - "{{dendrite_build_dir}}/bin/dendrite-demo-pinecone"
       
    45       - "{{dendrite_build_dir}}/bin/dendrite-demo-yggdrasil"
       
    46       - "{{dendrite_build_dir}}/bin/furl"
       
    47     dest: "{{dendrite_srv_dir}}/dendrite.tar.gz"
       
    48     format: "gz"
       
    49   when: not build_file.stat.exists