main.yml 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. - name: Git checkout source code(laravel)
  2. ansible.builtin.git:
  3. repo: "https://github.com/iapt-platform/mint.git"
  4. dest: "{{ app_deploy_target }}/htdocs"
  5. version: laravel
  6. force: true
  7. - name: Install v2 nodejs dependencies(laravel)
  8. ansible.builtin.shell: npm install
  9. args:
  10. chdir: "{{ app_deploy_target }}/htdocs"
  11. # TODO will remove in future
  12. - name: Install v1 php dependencies(laravel)
  13. ansible.builtin.shell: "php{{ app_php_version }} {{ ansible_env.HOME }}/.local/bin/composer install"
  14. args:
  15. chdir: "{{ app_deploy_target }}/htdocs/public"
  16. # TODO will remove in future
  17. - name: Install v1 nodejs dependencies(laravel)
  18. ansible.builtin.shell: npm install
  19. args:
  20. chdir: "{{ app_deploy_target }}/htdocs/public"
  21. # TODO will remove in future
  22. - name: Setup tmp folder(laravel)
  23. become: true
  24. ansible.builtin.file:
  25. path: "{{ app_deploy_target }}/tmp"
  26. state: directory
  27. recurse: true
  28. owner: www-data
  29. group: www-data
  30. # TODO will remove in future
  31. - name: Install v1 tmp(laravel)
  32. ansible.builtin.file:
  33. src: "{{ app_deploy_target }}/tmp"
  34. dest: "{{ app_deploy_target }}/htdocs/public/tmp"
  35. state: link
  36. - name: Install v2 php dependencies
  37. ansible.builtin.shell: "php{{ app_php_version }} {{ ansible_env.HOME }}/.local/bin/composer install"
  38. args:
  39. chdir: "{{ app_deploy_target }}/htdocs"
  40. - name: Setup storage folder(laravel)
  41. become: true
  42. ansible.builtin.file:
  43. path: "{{ app_deploy_target }}/storage"
  44. state: directory
  45. recurse: true
  46. owner: www-data
  47. group: www-data
  48. - name: Delete repo's storage folder(laravel)
  49. ansible.builtin.file:
  50. path: "{{ app_deploy_target }}/htdocs/storage"
  51. state: absent
  52. - name: create storage link(laravel)
  53. ansible.builtin.file:
  54. src: "{{ app_deploy_target }}/storage"
  55. dest: "{{ app_deploy_target }}/htdocs/storage"
  56. state: link
  57. - name: create v2 config file(laravel)
  58. ansible.builtin.file:
  59. src: "{{ app_deploy_target }}/etc/v2.env"
  60. dest: "{{ app_deploy_target }}/htdocs/.env"
  61. state: link
  62. # FIXME
  63. - name: create v1 config file(laravel)
  64. ansible.builtin.file:
  65. src: "{{ app_deploy_target }}/etc/v1.php"
  66. dest: "{{ app_deploy_target }}/htdocs/public/app/config.php"
  67. state: link
  68. - name: Git checkout source code(agile)
  69. ansible.builtin.git:
  70. repo: "https://github.com/iapt-platform/mint.git"
  71. dest: "{{ app_deploy_target }}/agile"
  72. version: agile
  73. - name: Install dashboard dependencies(agile)
  74. ansible.builtin.shell: yarn install
  75. args:
  76. chdir: "{{ app_deploy_target }}/agile/dashboard"
  77. - name: Upload dashboard folder
  78. ansible.builtin.copy:
  79. src: dashboard
  80. dest: "{{ app_deploy_target }}/"
  81. # - name: Build dashboard (agile)
  82. # ansible.builtin.shell: NODE_OPTIONS=--max-old-space-size=1024 GENERATE_SOURCEMAP=false BUILD_PATH={{ app_deploy_target }}/dashboard PUBLIC_URL=/pcd yarn build
  83. # args:
  84. # chdir: "{{ app_deploy_target }}/agile/dashboard"