main.yml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. - name: Create www folder
  2. become: true
  3. ansible.builtin.file:
  4. path: "{{ app_deploy_target | dirname }}"
  5. state: directory
  6. owner: "{{ ansible_user }}"
  7. mode: "0755"
  8. # ---------------------------------------------------------
  9. - name: Download source code
  10. ansible.builtin.unarchive:
  11. src: https://github.com/iapt-platform/mint/archive/{{ mint_version }}.zip
  12. dest: "{{ app_deploy_target | dirname }}"
  13. remote_src: true
  14. creates: "{{ app_deploy_target }}"
  15. # ---------------------------------------------------------
  16. # - name: Clone source codes directly
  17. # ansible.builtin.git:
  18. # repo: "https://github.com/iapt-platform/mint.git"
  19. # dest: "{{ app_deploy_target }}"
  20. # version: "{{ mint_version }}"
  21. # ---------------------------------------------------------
  22. # - name: Clone source codes to repo
  23. # ansible.builtin.git:
  24. # repo: "https://github.com/iapt-platform/mint.git"
  25. # dest: "{{ app_deploy_target | dirname }}/repo"
  26. # update: true
  27. # version: "development"
  28. # - name: Clone to from local repo
  29. # ansible.builtin.git:
  30. # repo: "{{ app_deploy_target | dirname }}/repo"
  31. # dest: "{{ app_deploy_target }}"
  32. # version: "{{ mint_version }}"
  33. # # depth: 1
  34. # # single_branch: true
  35. # ---------------------------------------------------------
  36. - name: Upload dashboard-v4 dist
  37. ansible.posix.synchronize:
  38. src: "{{ playbook_dir }}/tmp/mint/dashboard-v4/dashboard/dist-{{ mint_version }}/"
  39. dest: "{{ app_deploy_target }}/dashboard-v4/dashboard/dist/"
  40. - name: Upload docker shell script
  41. ansible.builtin.template:
  42. src: containers/shell.sh.j2
  43. dest: "{{ app_deploy_target }}/scripts/shell.sh"
  44. mode: "0555"
  45. - name: Setup laravel
  46. ansible.builtin.import_tasks: laravel.yml
  47. - name: Force systemd to reread configs
  48. become: true
  49. ansible.builtin.systemd:
  50. daemon_reload: true
  51. - name: Force systemd to reread configs(user)
  52. ansible.builtin.systemd:
  53. daemon_reload: true
  54. scope: user
  55. - name: Upload version.txt(api-v8)
  56. ansible.builtin.template:
  57. src: version.txt.j2
  58. dest: "{{ app_deploy_target }}/api-v8/public/version.txt"
  59. mode: "0555"
  60. - name: Upload version.txt(api-v12)
  61. ansible.builtin.template:
  62. src: version.txt.j2
  63. dest: "{{ app_deploy_target }}/api-v12/public/version.txt"
  64. mode: "0555"
  65. - name: Upload version.txt(dashboard-v4)
  66. ansible.builtin.template:
  67. src: version.txt.j2
  68. dest: "{{ app_deploy_target }}/dashboard-v4/dashboard/dist/version.txt"
  69. mode: "0555"