laravel-v8.yml 3.8 KB

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