laravel-v8.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. - name: Upload launch.sh
  2. ansible.builtin.template:
  3. src: launch.sh
  4. dest: "{{ app_deploy_target }}/scripts/"
  5. mode: "0555"
  6. - name: Setup third packages
  7. ansible.builtin.command:
  8. argv:
  9. - "{{ app_deploy_target }}/docker/mint/run.sh"
  10. - "{{ app_mint_image_name }}"
  11. - setup
  12. chdir: "{{ app_deploy_target }}/"
  13. creates: "{{ app_deploy_target }}/api-v8/public/node_modules"
  14. # - name: Setup nodejs packages for v2
  15. # ansible.builtin.command:
  16. # argv:
  17. # - "{{ app_deploy_target }}/docker/mint/run.sh"
  18. # - "{{ app_mint_image_name }}"
  19. # - npm
  20. # - install
  21. # chdir: "{{ app_deploy_target }}/api-v8"
  22. # creates: "{{ app_deploy_target }}/api-v8/node_modules"
  23. # - name: Upload .env(v2)
  24. # become: true
  25. # ansible.builtin.template:
  26. # src: v2/env.j2
  27. # dest: "{{ app_deploy_target }}/mint/api-v8/.env"
  28. # owner: www-data
  29. # group: www-data
  30. # mode: "0444"
  31. # - name: Upload config.php(v1)
  32. # ansible.builtin.become: true
  33. # ansible.builtin.template:
  34. # src: v1/config.php.j2
  35. # dest: "{{ app_deploy_target }}/mint/api-v8/public/app/config.php"
  36. # owner: www-data
  37. # group: www-data
  38. # mode: "0444"
  39. # - name: Upload config.js(v1)
  40. # become: true
  41. # ansible.builtin.template:
  42. # src: v1/config.js.j2
  43. # dest: "{{ app_deploy_target }}/mint/api-v8/public/app/config.js"
  44. # owner: www-data
  45. # group: www-data
  46. # mode: "0444"
  47. # - name: Setup bootstrap folder for {{ ansible_user }}
  48. # become: true
  49. # ansible.builtin.file:
  50. # path: "{{ app_deploy_target }}/mint/api-v8/bootstrap/cache"
  51. # state: directory
  52. # owner: "{{ ansible_user }}"
  53. # group: "{{ ansible_user }}"
  54. # recurse: true
  55. # - name: Auto-loader optimization for v2
  56. # ansible.builtin.command:
  57. # argv:
  58. # - /usr/bin/composer
  59. # - update
  60. # - --optimize-autoloader
  61. # - --no-dev
  62. # chdir: "{{ app_deploy_target }}/api-v8"
  63. # - name: Auto-loader optimization for v1
  64. # ansible.builtin.command:
  65. # argv:
  66. # chdir: "{{ app_deploy_target }}/mint/api-v8/public"
  67. # - name: Setup storage folder for v2 for php-fpm
  68. # become: true
  69. # ansible.builtin.file:
  70. # path: "{{ app_deploy_target }}/mint/api-v8/storage"
  71. # state: directory
  72. # owner: www-data
  73. # group: www-data
  74. # recurse: true
  75. # - name: Caching configuration
  76. # become: true
  77. # become_user: www-data
  78. # ansible.builtin.command:
  79. # argv:
  80. # - /usr/bin/php
  81. # - artisan
  82. # - config:cache
  83. # chdir: "{{ app_deploy_target}}/api-v8"
  84. # - name: Caching events
  85. # become: true
  86. # become_user: www-data
  87. # ansible.builtin.command:
  88. # argv:
  89. # - /usr/bin/php
  90. # - artisan
  91. # - event:cache
  92. # chdir: "{{ app_deploy_target }}/api-v8"
  93. # - name: Caching routes
  94. # become: true
  95. # become_user: www-data
  96. # ansible.builtin.command:
  97. # argv:
  98. # - /usr/bin/php
  99. # - artisan
  100. # - route:cache
  101. # chdir: "{{ app_deploy_target }}/api-v8"
  102. # - name: Caching views
  103. # become: true
  104. # become_user: www-data
  105. # ansible.builtin.shell:
  106. # argv:
  107. # - /usr/bin/php
  108. # - artisan
  109. # - view:cache
  110. # chdir: "{{ app_deploy_target }}/api-v8"
  111. # - name: Setup sqlite3 db for v1
  112. # become: true
  113. # ansible.builtin.file:
  114. # src: /var/www/shared/appdata
  115. # dest: "{{ app_deploy_target }}/mint/api-v8/storage/app/data"
  116. # state: link
  117. # # https://laravel.com/docs/10.x/scheduling#running-the-scheduler
  118. # - name: Upload scheduler service
  119. # become: true
  120. # ansible.builtin.template:
  121. # src: v2/scheduler.service.j2
  122. # dest: /usr/lib/systemd/system/{{ inventory_hostname }}-scheduler.service
  123. # owner: root
  124. # group: root
  125. # mode: "0644"
  126. # - name: Setup laravel queue workers
  127. # ansible.builtin.import_tasks: queue-workers.yml
  128. # - name: Setup morus service
  129. # ansible.builtin.import_tasks: morus.yml
  130. # - name: Setup lily service
  131. # ansible.builtin.import_tasks: lily.yml
  132. # - name: Setup tulip service
  133. # ansible.builtin.import_tasks: tulip.yml