[infra] Add script that updates checked in SDKs

Change-Id: I9de6489dbe613455476cd4c19db4b951456a87cf
Reviewed-on: https://dart-review.googlesource.com/53100
Reviewed-by: Jonas Termansen <sortie@google.com>
This commit is contained in:
Alexander Thomas 2018-05-01 18:50:31 +00:00
parent f8bea2a7e6
commit dcf10816aa
2 changed files with 58 additions and 6 deletions

View file

@ -14,9 +14,6 @@ arm and arm64 (aarch64) processors, respectively. We are currently
using the 32-bit ia32 build as the default on windows, and the 64-bit x64
build as the default on linux and macos.
To upload new versions of these tar files, use the "upload_to_google_storage"
tool in depot_tools, and download the new stable SDKs from the dartlang.org
web page. The arm executables must be copied from the machines that
build them, and stripped. Because these SDKs are used for the presubmit
dartfmt check on changed files, they may need to be updated often when
dartfmt is changing rapidly.
To upload new versions of these tar files, run "./update.sh" in this directory.
Because these SDKs are used for the presubmit dartfmt check on changed files,
they may need to be updated often when dartfmt is changing rapidly.

55
tools/sdks/update.sh Executable file
View file

@ -0,0 +1,55 @@
#!/usr/bin/env bash
# Updates the checked in SDKs
set -e
set -x
if [ -z "$1" ]; then
echo "Usage: update.sh version"
exit 1
fi
channel="stable"
case "$1" in
*-dev.*) channel="dev";;
esac
tmpdir=$(mktemp -d)
cleanup() {
rm -rf "$tmpdir"
}
trap cleanup EXIT HUP INT QUIT TERM PIPE
pushd "$tmpdir"
gsutil cp "gs://dart-archive/channels/$channel/release/$1/sdk/dartsdk-linux-x64-release.zip" .
gsutil cp "gs://dart-archive/channels/$channel/release/$1/sdk/dartsdk-linux-arm-release.zip" .
gsutil cp "gs://dart-archive/channels/$channel/release/$1/sdk/dartsdk-linux-arm64-release.zip" .
gsutil cp "gs://dart-archive/channels/$channel/release/$1/sdk/dartsdk-macos-x64-release.zip" .
gsutil cp "gs://dart-archive/channels/$channel/release/$1/sdk/dartsdk-windows-ia32-release.zip" .
unzip -q dartsdk-linux-arm-release.zip dart-sdk/bin/dart
mv dart-sdk/bin/dart dart-sdk/bin/dart-arm
unzip -q dartsdk-linux-arm64-release.zip dart-sdk/bin/dart
mv dart-sdk/bin/dart dart-sdk/bin/dart-arm64
unzip -q dartsdk-linux-x64-release.zip
tar -czf dart-sdk.tar.gz dart-sdk
upload_to_google_storage.py -b dart-dependencies dart-sdk.tar.gz
mv dart-sdk.tar.gz.sha1 dart-sdk.tar.gz.sha1-linux
rm -rf dart-sdk
unzip -q dartsdk-macos-x64-release.zip
tar -czf dart-sdk.tar.gz dart-sdk
upload_to_google_storage.py -b dart-dependencies dart-sdk.tar.gz
mv dart-sdk.tar.gz.sha1 dart-sdk.tar.gz.sha1-mac
rm -rf dart-sdk
unzip -q dartsdk-windows-ia32-release.zip
tar -czf dart-sdk.tar.gz dart-sdk
upload_to_google_storage.py -b dart-dependencies dart-sdk.tar.gz
mv dart-sdk.tar.gz.sha1 dart-sdk.tar.gz.sha1-win
rm -rf dart-sdk
popd
mv $tmpdir/dart-sdk.tar.gz.sha1-linux linux/dart-sdk.tar.gz.sha1
mv $tmpdir/dart-sdk.tar.gz.sha1-mac mac/dart-sdk.tar.gz.sha1
mv $tmpdir/dart-sdk.tar.gz.sha1-win win/dart-sdk.tar.gz.sha1