aboutsummaryrefslogtreecommitdiffstats
path: root/coin/provisioning/qtci-macos-10.12-x86_64
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2017-04-18 12:50:34 +0200
committerTony Sarajärvi <tony.sarajarvi@qt.io>2017-04-21 06:22:10 +0000
commitce9181a96433e50fe8b5cc79876eeffa6971c2ce (patch)
treec1266baedc280dda39b32797139f6a57a7cfdd34 /coin/provisioning/qtci-macos-10.12-x86_64
parent6b086604c1993de759f3a7c429e71bf68e38d486 (diff)
Improve reliability of automated xcode installation
Instead of downloading a 4+GB archive and uncompressing it in /tmp, let's uncompress the archive via NFS and feed the data straight into cpio. This should be faster and avoids curl's error handling that's happy to abort instead of re-trying. Change-Id: Ifa5d842c50111ccdbd56e795b270ee6433a63adf Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
Diffstat (limited to 'coin/provisioning/qtci-macos-10.12-x86_64')
-rwxr-xr-xcoin/provisioning/qtci-macos-10.12-x86_64/020-xcode.sh65
1 files changed, 3 insertions, 62 deletions
diff --git a/coin/provisioning/qtci-macos-10.12-x86_64/020-xcode.sh b/coin/provisioning/qtci-macos-10.12-x86_64/020-xcode.sh
index 070ed049..97ce19ba 100755
--- a/coin/provisioning/qtci-macos-10.12-x86_64/020-xcode.sh
+++ b/coin/provisioning/qtci-macos-10.12-x86_64/020-xcode.sh
@@ -45,66 +45,7 @@
# shellcheck source=../common/try_catch.sh
source "${BASH_SOURCE%/*}/../common/try_catch.sh"
-ExceptionDownloadUrl=100
-ExceptionSHA1=101
-ExceptionUnXZ=102
-ExceptionCPIO=103
-ExceptionDelete=104
-ExceptionAcceptLicense=105
+# shellcheck source=../common/install_xcode.sh
+source "${BASH_SOURCE%/*}/../common/install_xcode.sh"
-
-url=http://ci-files01-hki.ci.local/input/mac/macos_10.12_sierra/Xcode_8.2.1.xz
-targetFile=/tmp/Xcode_8.2.1.xz
-expectedSha1=a68e8a4446f77e781b1ce123125263862f2607a3
-
-try
-(
- echo "Downloading Xcode from primary URL '$url'"
- curl --fail -L --retry 5 --retry-delay 5 -o "$targetFile" "$url" || throw $ExceptionDownloadUrl
-
- echo "Checking SHA1 on $targetFile"
- echo "$expectedSha1 *$targetFile" | shasum --check || throw $ExceptionSHA1
-
- echo "Uncompressing '$targetFile'"
- xz -d "$targetFile" || throw $ExceptionUnXZ
-
- echo "Unarchiving '${targetFile%.*}'"
- (cd /Applications/ && sudo cpio -dmiI "${targetFile%.*}") || throw $ExceptionCPIO
-
- echo "Deleting '${targetFile%.*}'"
- rm "${targetFile%.*}" || throw $ExceptionDelete
-
- echo "Accept license"
- sudo xcodebuild -license accept || throw $ExceptionAcceptLicense
-
- echo "XCode = 8.2.1" >> ~/versions.txt
-)
-catch || {
- case $ex_code in
- $ExceptionDownloadUrl)
- echo "Failed to download Xcode."
- exit 1;
- ;;
- $ExceptionSHA1)
- echo "Failed to check SHA1."
- exit 1;
- ;;
- $ExceptionUnXZ)
- echo "Failed to uncompress .xz"
- exit 1;
- ;;
- $ExceptionCPIO)
- echo "Failed to unarchive .cpio."
- exit 1;
- ;;
- $ExceptionDelete)
- echo "Failed to delete temporary file."
- exit 1;
- ;;
- $ExceptionAcceptLicense)
- echo "Failed to accept license."
- exit 1;
- ;;
-
- esac
-}
+InstallXCode /net/ci-files01-hki.ci.local/hdd/www/input/mac/macos_10.12_sierra/Xcode_8.2.1.xz 8.2.1