bin/build/tasks/main.yaml
changeset 228 ff776d663062
equal deleted inserted replaced
227:2e0366f2dcbe 228:ff776d663062
       
     1 ---
       
     2 
       
     3 - name: install cargo
       
     4   become: yes
       
     5   apt: name="cargo"
       
     6 
       
     7 - name: unarchive bin
       
     8   unarchive:
       
     9     remote_src: yes
       
    10     src: "{{bin_tar}}"
       
    11     dest: "/tmp/"
       
    12     creates: "{{bin_build_dir}}"
       
    13 
       
    14 - name: check if bin build exists
       
    15   stat:
       
    16     path: "{{bin_build_dir}}/target/release/bin"
       
    17   register: build_file
       
    18 
       
    19 - name: build bin
       
    20   command: "cargo build --release"
       
    21   args:
       
    22     chdir: "{{bin_build_dir}}"
       
    23   when: not build_file.stat.exists
       
    24 
       
    25 - name: create build server dir
       
    26   become: yes
       
    27   file:
       
    28     path: "{{bin_srv_dir}}"
       
    29     mode: "0755"
       
    30     state: "directory"
       
    31 
       
    32 - name: copy bin to build server dir
       
    33   become: yes
       
    34   copy:
       
    35     remote_src: yes
       
    36     src: "{{bin_build_dir}}/target/release/bin"
       
    37     dest: "{{bin_srv_dir}}/bin"