Archived
1
0
This repository has been archived on 2024-09-09. You can view files and clone it, but cannot push or open issues or pull requests.
code-server/scripts/ci.bash

40 lines
1.2 KiB
Bash
Raw Normal View History

2019-07-03 02:10:17 +02:00
#!/bin/bash
# ci.bash -- Build code-server in the CI.
2019-07-12 00:12:52 +02:00
set -euo pipefail
2019-07-11 01:10:39 +02:00
2019-07-03 02:10:17 +02:00
function main() {
cd "$(dirname "${0}")/.."
# Get the version information. If a specific version wasn't set, generate it
# from the tag and VS Code version.
local vscode_version=${VSCODE_VERSION:-1.41.1}
local code_server_version=${VERSION:-2.${TRAVIS_TAG:-${DRONE_TAG:-daily}}-vsc$vscode_version}
2019-07-03 02:10:17 +02:00
# Remove everything that isn't the current VS Code source for caching
# (otherwise the cache will contain old versions).
if [[ -d "source/vscode-$vscode_version-source" ]] ; then
mv "source/vscode-$vscode_version-source" "vscode-$vscode_version-source"
fi
rm -rf source/vscode-*-source
if [[ -d "vscode-$vscode_version-source" ]] ; then
mv "vscode-$vscode_version-source" "source/vscode-$vscode_version-source"
2019-07-03 02:10:17 +02:00
fi
# Only minify and package on tags since that's when releases are pushed.
if [[ -n ${DRONE_TAG:-} || -n ${TRAVIS_TAG:-} ]] ; then
export MINIFY="true"
export PACKAGE="true"
2019-07-03 02:10:17 +02:00
fi
function run-yarn() {
yarn "$1" "$vscode_version" "$code_server_version"
}
run-yarn build
[[ -n ${PACKAGE:-} || -n ${BINARY:-} ]] && run-yarn binary
[[ -n ${PACKAGE:-} ]] && run-yarn package
2019-07-03 02:10:17 +02:00
}
main "$@"