meshviewer.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ---
  2. # tasks file for meshviewer
  3. - name: Install build dependencies
  4. apt: name={{item}} state=present update_cache=yes cache_valid_time=3600
  5. with_items: "{{meshviewer_build_dependencies}}"
  6. - name: Create meshviewer install directory
  7. file: name={{meshviewer_install_directory}} state=directory
  8. - name: Create meshviewer build directory
  9. file: name={{meshviewer_build_directory}} state=directory
  10. - name: Clone meshviewer
  11. register: meshviewer_cloned
  12. git: repo={{meshviewer_repo}} dest={{meshviewer_build_directory}} version={{meshviewer_version}}
  13. - name: Install npm build dependencies
  14. command: npm install
  15. when: meshviewer_cloned|changed
  16. register: meshviewer_npm_installed
  17. args:
  18. chdir: "{{meshviewer_build_directory}}/"
  19. creates: "{{meshviewer_build_directory}}/node_modules"
  20. - name: Install bower and grunt
  21. when: meshviewer_npm_installed|changed
  22. command: npm install bower grunt-cli
  23. args:
  24. chdir: "{{meshviewer_build_directory}}"
  25. - name: Build meshviewer
  26. command: node_modules/.bin/grunt
  27. args:
  28. chdir: "{{meshviewer_build_directory}}/"
  29. creates: "{{meshviewer_build_directory}}/build"
  30. - name: Copy meshviewer into install directory
  31. shell: cp -r {{meshviewer_build_directory}}/build/* {{meshviewer_install_directory}}
  32. - name: Install build config
  33. template: src=config.js.j2 dest="{{meshviewer_build_directory}}/config.js"
  34. - name: Copy config
  35. template: src=config.js.j2 dest="{{meshviewer_install_directory}}/config.js"