main.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. - name: Create www folder
  2. become: true
  3. ansible.builtin.file:
  4. path: "/mnt/www/{{ inventory_hostname }}"
  5. state: directory
  6. mode: "0755"
  7. - name: Download source code
  8. ansible.builtin.unarchive:
  9. src: https://github.com/iapt-platform/mint/archive/{{ mint_version }}.zip
  10. dest: "/mnt/www/{{ inventory_hostname }}"
  11. remote_src: true
  12. creates: "{{ app_deploy_target }}"
  13. # - name: Install third packages
  14. # ansible.builtin.command: docker/mint/run.sh {{ app_mint_image_name }} setup
  15. # args:
  16. # chdir: "{{ ansible_env.HOME }}/build/mint-{{ mint_version }}"
  17. # creates: "{{ ansible_env.HOME }}/build/mint-{{ mint_version }}/api-v8/public/node_modules"
  18. # if [ "$1" == "fpm" ]; then
  19. # echo "start fpm worker"
  20. # # TODO
  21. # elif [ "$1" == "setup" ]; then
  22. # cd $WORK_DIR/api-v8/
  23. # composer install --optimize-autoloader --no-dev
  24. # npm install
  25. # cd $WORK_DIR/api-v8/public/
  26. # composer install --optimize-autoloader --no-dev
  27. # npm install
  28. # elif [ "$1" == "db-migrate" ]; then
  29. # echo "migrate database"
  30. # # TODO
  31. # else
  32. # echo $USAGE
  33. # exit 1
  34. # fi
  35. - name: Upload dashboard-v4 dist
  36. ansible.posix.synchronize:
  37. src: "{{ playbook_dir }}/tmp/mint/dashboard-v4/dashboard/dist-{{ mint_version }}"
  38. dest: "{{ app_deploy_target }}/dashboard-v4/dashboard"