mint.yml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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_MPS_CODE: "{{ app_mps_code }}"
  25. REACT_APP_QUESTIONNAIRE_LINK: "{{ app_questionnaire_link }}"
  26. - name: deploy php-fpm servers
  27. hosts:
  28. - php_fpm
  29. roles:
  30. # FIXME: conflict with php daemon
  31. # - php
  32. - mint-v2
  33. # - name: run db migrations
  34. # hosts:
  35. # - dbm
  36. # tasks:
  37. # - name: run laravel db -migrate
  38. # become: true
  39. # ansible.builtin.shell:
  40. # cmd: su www-data -pc "php artisan migrate"
  41. # chdir: "{{ app_deploy_root }}/htdocs"
  42. - name: setup tulip
  43. hosts:
  44. - tulip
  45. tasks:
  46. - name: setup tmp folder
  47. become: true
  48. ansible.builtin.file:
  49. path: "{{ app_deploy_root }}/agile/rpc/tulip/tulip/tmp"
  50. state: directory
  51. owner: "www-data"
  52. group: "www-data"
  53. - name: upload pali.stop
  54. become: true
  55. ansible.builtin.copy:
  56. dest: "/usr/share/postgresql/{{ app_postgresql_version }}/tsearch_data/"
  57. src: "{{ playbook_dir }}/../rpc/tulip/tulip/dictionary/pali.stop"
  58. owner: root
  59. group: root
  60. mode: "0644"
  61. - name: upload pali.syn
  62. become: true
  63. ansible.builtin.copy:
  64. dest: "/usr/share/postgresql/{{ app_postgresql_version }}/tsearch_data/"
  65. src: "{{ playbook_dir }}/../rpc/tulip/tulip/dictionary/pali.syn"
  66. owner: root
  67. group: root
  68. mode: "0644"
  69. - name: restrat postgresql server
  70. become: true
  71. ansible.builtin.systemd:
  72. state: restarted
  73. name: postgresql
  74. - name: run tulip db migrate
  75. ansible.builtin.shell:
  76. cmd: dbmate up
  77. chdir: "{{ app_deploy_root }}/agile/rpc/tulip/tulip/db"
  78. - name: restrat mint-{{ app_deploy_env }}-tulip service
  79. become: true
  80. ansible.builtin.systemd:
  81. state: restarted
  82. name: mint-{{ app_deploy_env }}-tulip.service