main.yml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. - name: Setup clove resources
  16. ansible.builtin.import_tasks: clove.yml
  17. # ---------------------------------------------------------
  18. # - name: Clone source codes directly
  19. # ansible.builtin.git:
  20. # repo: "https://github.com/iapt-platform/mint.git"
  21. # dest: "{{ app_deploy_target }}"
  22. # version: "{{ mint_version }}"
  23. # ---------------------------------------------------------
  24. # - name: Clone source codes to repo
  25. # ansible.builtin.git:
  26. # repo: "https://github.com/iapt-platform/mint.git"
  27. # dest: "{{ app_deploy_target | dirname }}/repo"
  28. # update: true
  29. # version: "development"
  30. # - name: Clone to from local repo
  31. # ansible.builtin.git:
  32. # repo: "{{ app_deploy_target | dirname }}/repo"
  33. # dest: "{{ app_deploy_target }}"
  34. # version: "{{ mint_version }}"
  35. # # depth: 1
  36. # # single_branch: true
  37. # ---------------------------------------------------------
  38. - name: Upload dashboard-v4 dist
  39. ansible.posix.synchronize:
  40. src: "{{ playbook_dir }}/tmp/mint/dashboard-v4/dashboard/dist-{{ mint_version }}/"
  41. dest: "{{ app_deploy_target }}/dashboard-v4/dashboard/dist/"
  42. - name: Upload docker shell script
  43. ansible.builtin.template:
  44. src: containers/api-v8.sh.j2
  45. dest: "{{ app_deploy_target }}/scripts/api-v8.sh"
  46. mode: "0555"
  47. - name: Setup laravel
  48. ansible.builtin.import_tasks: laravel.yml
  49. - name: Setup ai-translate
  50. ansible.builtin.import_tasks: ai-translate.yml
  51. - name: Setup openai-proxy
  52. ansible.builtin.import_tasks: openai-proxy.yml
  53. - name: Force systemd to reread configs
  54. become: true
  55. ansible.builtin.systemd:
  56. daemon_reload: true
  57. - name: Force systemd to reread configs(user)
  58. ansible.builtin.systemd:
  59. daemon_reload: true
  60. scope: user
  61. - name: Upload version.txt(api-v8)
  62. ansible.builtin.template:
  63. src: version.txt.j2
  64. dest: "{{ app_deploy_target }}/api-v8/public/version.txt"
  65. mode: "0555"
  66. - name: Upload version.txt(api-v12)
  67. ansible.builtin.template:
  68. src: version.txt.j2
  69. dest: "{{ app_deploy_target }}/api-v12/public/version.txt"
  70. mode: "0555"
  71. - name: Upload version.txt(dashboard-v4)
  72. ansible.builtin.template:
  73. src: version.txt.j2
  74. dest: "{{ app_deploy_target }}/dashboard-v4/dashboard/dist/version.txt"
  75. mode: "0555"