build.sh 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #!/bin/bash
  2. function keep_alive_small() {
  3. while true; do
  4. echo .
  5. read -t 60 < /proc/self/fd/1 > /dev/null 2>&1
  6. done
  7. }
  8. function keep_alive() {
  9. while true; do
  10. date
  11. sleep 60
  12. done
  13. }
  14. if [[ "$SHOULD_BUILD" == "yes" ]]; then
  15. export BUILD_SOURCEVERSION=$LATEST_MS_COMMIT
  16. echo "LATEST_MS_COMMIT: ${LATEST_MS_COMMIT}"
  17. echo "BUILD_SOURCEVERSION: ${BUILD_SOURCEVERSION}"
  18. export npm_config_arch="$BUILDARCH"
  19. export npm_config_target_arch="$BUILDARCH"
  20. ./prepare_vscode.sh
  21. cd vscode || exit
  22. export NODE_ENV=production
  23. # these tasks are very slow, so using a keep alive to keep travis alive
  24. if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
  25. keep_alive_small &
  26. else
  27. keep_alive &
  28. fi
  29. KA_PID=$!
  30. yarn gulp compile-build
  31. yarn gulp compile-extensions-build
  32. yarn gulp minify-vscode
  33. yarn gulp minify-vscode-reh
  34. yarn gulp minify-vscode-reh-web
  35. if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
  36. npm install --global create-dmg
  37. yarn gulp vscode-darwin-min-ci
  38. yarn gulp vscode-reh-darwin-min-ci
  39. yarn gulp vscode-reh-web-darwin-min-ci
  40. elif [[ "$CI_WINDOWS" == "True" ]]; then
  41. cp LICENSE.txt LICENSE.rtf # windows build expects rtf license
  42. yarn gulp "vscode-win32-${BUILDARCH}-min-ci"
  43. yarn gulp "vscode-reh-win32-${BUILDARCH}-min-ci"
  44. yarn gulp "vscode-reh-web-win32-${BUILDARCH}-min-ci"
  45. yarn gulp "vscode-win32-${BUILDARCH}-code-helper"
  46. yarn gulp "vscode-win32-${BUILDARCH}-inno-updater"
  47. yarn gulp "vscode-win32-${BUILDARCH}-archive"
  48. yarn gulp "vscode-win32-${BUILDARCH}-system-setup"
  49. yarn gulp "vscode-win32-${BUILDARCH}-user-setup"
  50. else # linux
  51. yarn gulp vscode-linux-${BUILDARCH}-min-ci
  52. yarn gulp vscode-reh-linux-${BUILDARCH}-min-ci
  53. yarn gulp vscode-reh-web-linux-${BUILDARCH}-min-ci
  54. yarn gulp "vscode-linux-${BUILDARCH}-build-deb"
  55. if [[ "$BUILDARCH" == "x64" ]]; then
  56. yarn gulp "vscode-linux-${BUILDARCH}-build-rpm"
  57. fi
  58. . ../create_appimage.sh
  59. fi
  60. kill $KA_PID
  61. cd ..
  62. fi