build_docker.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/bin/bash
  2. exists() { type -t "$1" > /dev/null 2>&1; }
  3. export CI_BUILD="no"
  4. export OS_NAME="linux"
  5. export SHOULD_BUILD="yes"
  6. export SKIP_PACKAGES="yes"
  7. export VSCODE_LATEST="no"
  8. export VSCODE_QUALITY="stable"
  9. while getopts ":ilp" opt; do
  10. case "$opt" in
  11. i)
  12. export VSCODE_QUALITY="insider"
  13. ;;
  14. l)
  15. export VSCODE_LATEST="yes"
  16. ;;
  17. p)
  18. export SKIP_PACKAGES="no"
  19. ;;
  20. esac
  21. done
  22. if ! exists yarn; then
  23. curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
  24. sudo apt-get install -y nodejs desktop-file-utils
  25. npm install -g yarn
  26. fi
  27. UNAME_ARCH=$( uname -m )
  28. if [[ "${UNAME_ARCH}" == "x86_64" ]]; then
  29. export VSCODE_ARCH="x64"
  30. else
  31. export npm_config_arch=armv7l
  32. export npm_config_force_process_config="true"
  33. export VSCODE_ARCH="armhf"
  34. fi
  35. echo "OS_NAME=\"${OS_NAME}\""
  36. echo "SKIP_PACKAGES=\"${SKIP_PACKAGES}\""
  37. echo "VSCODE_ARCH=\"${VSCODE_ARCH}\""
  38. echo "VSCODE_LATEST=\"${VSCODE_LATEST}\""
  39. echo "VSCODE_QUALITY=\"${VSCODE_QUALITY}\""
  40. rm -rf vscode* VSCode*
  41. . get_repo.sh
  42. . build.sh
  43. if [[ "${SKIP_PACKAGES}" == "no" ]]; then
  44. . prepare_artifacts.sh
  45. fi