2
0

deploy-pipelines.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/usr/bin/env bash
  2. set -e
  3. GH=false
  4. DAY=false
  5. for ARG in "$@"; do
  6. case "$ARG" in
  7. -gh)
  8. GH=true
  9. ;;
  10. -day)
  11. DAY=true
  12. ;;
  13. esac
  14. done
  15. echo "List:"
  16. ls -al
  17. ROOT_DIR="$(pwd)"
  18. DIST_DIR="$(pwd)/dist"
  19. VERSION=$(node -p "require('./package.json').version")
  20. echo "Start build version: ${VERSION}"
  21. if [[ ${DAY} == true ]]; then
  22. echo ""
  23. echo "Download day @delon/* libs"
  24. echo ""
  25. bash ./scripts/_ci/delon.sh
  26. fi
  27. echo ""
  28. echo "Generate color less"
  29. echo ""
  30. npm run color-less
  31. echo ""
  32. echo "Generate theme files"
  33. echo ""
  34. npm run theme
  35. echo '===== need mock'
  36. cp -f ${ROOT_DIR}/src/environments/environment.ts ${ROOT_DIR}/src/environments/environment.prod.ts
  37. sed -i 's/production: false/production: true/g' ${ROOT_DIR}/src/environments/environment.prod.ts
  38. sed -i 's/showSettingDrawer = !environment.production;/showSettingDrawer = true;/g' ${ROOT_DIR}/src/app/layout/basic/basic.component.ts
  39. if [[ ${GH} == true ]]; then
  40. echo "Build angular [github gh-pages]"
  41. node --max_old_space_size=5120 ./node_modules/@angular/cli/bin/ng build --base-href /ng-alain/
  42. else
  43. echo "Build angular"
  44. node --max_old_space_size=5120 ./node_modules/@angular/cli/bin/ng build
  45. fi
  46. cp -f ${DIST_DIR}/index.html ${DIST_DIR}/404.html
  47. echo "Finished"