mint.yml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. - name: "local compile"
  2. hosts: building
  3. tasks:
  4. - name: "install dashboard dependencies"
  5. ansible.builtin.shell:
  6. cmd: yarn install
  7. chdir: "{{ playbook_dir }}/../dashboard"
  8. - name: "build dashboard"
  9. ansible.builtin.shell:
  10. cmd: yarn build
  11. chdir: "{{ playbook_dir }}/../dashboard"
  12. environment:
  13. NODE_OPTIONS: "--max_old_space_size=4096"
  14. PUBLIC_URL: "{{ app_dashboard_base_path }}"
  15. REACT_APP_DEFAULT_LOCALE: "zh-Hans"
  16. REACT_APP_LANGUAGES: "en-US,zh-Hans,zh-Hant"
  17. REACT_APP_ENABLE_LOCAL_TOKEN: "true"
  18. REACT_APP_TOKEN_KEY: "token.20230919"
  19. REACT_APP_DOCUMENTS_SERVER: "{{ app_documents_server }}"
  20. REACT_APP_RPC_SERVER: "{{ app_grpc_web_server }}"
  21. REACT_APP_ASSETS_SERVER: "{{ app_assets_server }}"
  22. REACT_APP_API_SERVER: "https://{{ app_domain }}"
  23. REACT_APP_ICP_CODE: "{{ app_icp_code }}"
  24. REACT_APP_QUESTIONNAIRE_LINK: "{{ app_questionnaire_link }}"
  25. - name: deploy php-fpm servers
  26. hosts:
  27. - php_fpm
  28. roles:
  29. - mint-v2
  30. # - name: run db migration
  31. # hosts:
  32. # - dbm
  33. # tasks:
  34. # - name: run db-migrate
  35. # become: true
  36. # ansible.builtin.shell:
  37. # cmd: su www-data -pc "php artisan migrate"
  38. # chdir: "{{ app_deploy_root }}/htdocs"
  39. - name: setup tulip
  40. hosts:
  41. - tulip
  42. tasks:
  43. - name: setup tmp folder
  44. become: true
  45. ansible.builtin.file:
  46. path: "{{ app_deploy_root }}/agile/rpc/tulip/tulip/tmp"
  47. state: directory
  48. owner: "www-data"
  49. group: "www-data"
  50. - name: upload pali.stop
  51. become: true
  52. ansible.builtin.copy:
  53. dest: "/usr/share/postgresql/{{ app_postgresql_version }}/tsearch_data/"
  54. src: "{{ playbook_dir }}/../rpc/tulip/tulip/dictionary/pali.stop"
  55. owner: root
  56. group: root
  57. mode: "0644"
  58. - name: upload pali.syn
  59. become: true
  60. ansible.builtin.copy:
  61. dest: "/usr/share/postgresql/{{ app_postgresql_version }}/tsearch_data/"
  62. src: "{{ playbook_dir }}/../rpc/tulip/tulip/dictionary/pali.syn"
  63. owner: root
  64. group: root
  65. mode: "0644"
  66. - name: restrat postgresql server
  67. become: true
  68. ansible.builtin.systemd:
  69. state: restarted
  70. name: postgresql
  71. - name: run db migrate
  72. ansible.builtin.shell:
  73. cmd: dbmate up
  74. chdir: "{{ app_deploy_root }}/agile/rpc/tulip/tulip/db"
  75. - name: restrat mint-{{ app_deploy_env }}-tulip service
  76. become: true
  77. ansible.builtin.systemd:
  78. state: restarted
  79. name: mint-{{ app_deploy_env }}-tulip.service