build.sh.j2 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #!/bin/bash
  2. set -e
  3. source $HOME/.sdkman/bin/sdkman-init.sh
  4. source $HOME/.nvm/nvm.sh
  5. # cd {{ app_deploy_target }}/dashboard-v4/dashboard/
  6. # if [ -d dist ]
  7. # then
  8. # rm -f dist
  9. # fi
  10. # https://github.com/iapt-platform/mint/blob/5e81587433455cbc4994da49db5b880cf79e3539/dashboard-v4/dashboard/.env.orig#L17
  11. # NODE_OPTIONS="--max_old_space_size=2048" \
  12. # PUBLIC_URL="{{ app_dashboard_base_path }}" \
  13. # BUILD_PATH: "dist-{{ app_domain }}-{{ mint_version }}"
  14. # REACT_APP_DEFAULT_LOCALE="zh-Hans" \
  15. # REACT_APP_LANGUAGES="en-US,zh-Hans,zh-Hant" \
  16. # REACT_APP_ENABLE_LOCAL_TOKEN="true" \
  17. # REACT_APP_TOKEN_KEY="token.20250320" \
  18. # REACT_APP_DOCUMENTS_SERVER="{{ app_documents_server }}" \
  19. # REACT_APP_RPC_SERVER="{{ app_grpc_web_server }}" \
  20. # REACT_APP_ASSETS_SERVER="{{ app_assets_server }}" \
  21. # REACT_APP_API_SERVER="https://{{ app_domain }}" \
  22. # REACT_APP_ICP_CODE="{{ app_icp_code }}" \
  23. # REACT_APP_MPS_CODE="{{ app_mps_code }}" \
  24. # REACT_APP_QUESTIONNAIRE_LINK="{{ app_questionnaire_link }}" \
  25. # REACT_APP_OPENAI_PROXY="{{ app_openai_proxy_server }}/api/openai" \
  26. # npm run build
  27. cd {{ app_deploy_target }}/api-v8/
  28. NO_COLOR=true npm install --quiet
  29. php8.1 /usr/local/bin/composer install --no-ansi --quiet
  30. cd {{ app_deploy_target }}/api-v8/public
  31. NO_COLOR=true npm install --quiet
  32. php8.1 /usr/local/bin/composer install --no-ansi --quiet
  33. cd {{ app_deploy_target }}/api-v12/
  34. NO_COLOR=true npm install --quiet
  35. php8.4 /usr/local/bin/composer install --no-ansi --quiet
  36. # cd {{ app_deploy_target }}/open-ai-server/
  37. # npm install
  38. # if [ -d dist ]
  39. # then
  40. # rm -f dist
  41. # fi
  42. # npm run build
  43. cd {{ app_deploy_target }}/ai-translate/
  44. if [ ! -d python3 ]
  45. then
  46. python3.13 -m venv $PWD/python3
  47. fi
  48. source $PWD/python3/bin/activate
  49. if [ ! -f get-pip.py ]
  50. then
  51. wget -O get-pip.py https://bootstrap.pypa.io/get-pip.py
  52. fi
  53. python get-pip.py
  54. python -m pip install --quiet -e .
  55. deactivate
  56. mkdir -p {{ app_deploy_target }}/tmp/{{ app_domain }}
  57. cd {{ app_deploy_target }}/tmp/{{ app_domain }}/
  58. tar cf mint-{{ mint_version }}.tar -C {{ app_deploy_target }} \
  59. api-v12 api-v8 \
  60. dashboard-v4/dashboard/dist open-ai-server/dist \
  61. ai-translate/ai_translate ai-translate/pyproject.toml ai-translate/python3
  62. xz -z -F xz -C sha256 --best -T +1 mint-{{ mint_version }}.tar
  63. exit 0