build_full_frontend.sh 2.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #!/bin/bash
  2. # shellcheck disable=SC1091
  3. . bash_library.sh # source bash_library.sh
  4. windoz=""
  5. if [[ $1 = "-w" ]]; then
  6. windoz="windoz"
  7. fi
  8. echo -e "\n${BROWN}/!\ ${NC}this script does not run 'npm install'\n${BROWN}/!\ ${NC}it also assumes your webpack dev server of frontend is running"
  9. # Tracim Lib
  10. log "build frontend_lib"
  11. (
  12. cd frontend_lib || exit
  13. npm run buildtracimlib$windoz
  14. )
  15. # app Html Document
  16. log "build frontend_app_html-document"
  17. (
  18. cd frontend_app_html-document || exit
  19. npm run build$windoz
  20. )
  21. log "copying built file to frontend/"
  22. cp frontend_app_html-document/dist/html-document.app.js frontend/dist/app/
  23. log "copying en translation.json"
  24. cp frontend_app_html-document/i18next.scanner/en/translation.json frontend/dist/app/html-document_en_translation.json
  25. log "copying fr translation.json"
  26. cp frontend_app_html-document/i18next.scanner/fr/translation.json frontend/dist/app/html-document_fr_translation.json
  27. # app Thread
  28. log "build frontend_app_thread"
  29. (
  30. cd frontend_app_thread || exit
  31. npm run build$windoz
  32. )
  33. log "copying built file to frontend/"
  34. cp frontend_app_thread/dist/thread.app.js frontend/dist/app/
  35. log "copying Thread en translation.json"
  36. cp frontend_app_thread/i18next.scanner/en/translation.json frontend/dist/app/thread_en_translation.json
  37. log "copying Thread fr translation.json"
  38. cp frontend_app_thread/i18next.scanner/fr/translation.json frontend/dist/app/thread_fr_translation.json
  39. # app Workspace
  40. log "build frontend_app_workspace"
  41. (
  42. cd frontend_app_workspace || exit
  43. npm run build$windoz
  44. )
  45. log "copying built file to frontend/"
  46. cp frontend_app_workspace/dist/workspace.app.js frontend/dist/app/
  47. log "copying Thread en translation.json"
  48. cp frontend_app_workspace/i18next.scanner/en/translation.json frontend/dist/app/workspace_en_translation.json
  49. log "copying Thread fr translation.json"
  50. cp frontend_app_workspace/i18next.scanner/fr/translation.json frontend/dist/app/workspace_fr_translation.json
  51. # app Admin Workspace User
  52. log "build frontend_app_admin_workspace_user"
  53. (
  54. cd frontend_app_admin_workspace_user || exit
  55. npm run build$windoz
  56. )
  57. log "copying built file to frontend/"
  58. cp frontend_app_admin_workspace_user/dist/admin_workspace_user.app.js frontend/dist/app/
  59. log "copying Thread en translation.json"
  60. cp frontend_app_admin_workspace_user/i18next.scanner/en/translation.json frontend/dist/app/admin_workspace_user_en_translation.json
  61. log "copying Thread fr translation.json"
  62. cp frontend_app_admin_workspace_user/i18next.scanner/fr/translation.json frontend/dist/app/admin_workspace_user_fr_translation.json
  63. log "frontend fully built"