diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2017-04-18 12:50:34 +0200 |
---|---|---|
committer | Tony Sarajärvi <tony.sarajarvi@qt.io> | 2017-04-21 06:22:10 +0000 |
commit | ce9181a96433e50fe8b5cc79876eeffa6971c2ce (patch) | |
tree | c1266baedc280dda39b32797139f6a57a7cfdd34 /coin/provisioning/qtci-osx-10.11-x86_64 | |
parent | 6b086604c1993de759f3a7c429e71bf68e38d486 (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-osx-10.11-x86_64')
-rwxr-xr-x | coin/provisioning/qtci-osx-10.11-x86_64/020-xcode.sh | 67 |
1 files changed, 3 insertions, 64 deletions
diff --git a/coin/provisioning/qtci-osx-10.11-x86_64/020-xcode.sh b/coin/provisioning/qtci-osx-10.11-x86_64/020-xcode.sh index 44453e55..7555c752 100755 --- a/coin/provisioning/qtci-osx-10.11-x86_64/020-xcode.sh +++ b/coin/provisioning/qtci-osx-10.11-x86_64/020-xcode.sh @@ -47,68 +47,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 - - -url=http://ci-files01-hki.ci.local/input/mac/Xcode_8.2.xz -targetFile=/tmp/Xcode_8.2.xz -expectedSha1=46edc920955e315d946e36c45f629d5ee9dc9d59 - -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" >> ~/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 -} - +# shellcheck source=../common/install_xcode.sh +source "${BASH_SOURCE%/*}/../common/install_xcode.sh" +InstallXCode /net/ci-files01-hki.ci.local/hdd/www/input/mac/Xcode_8.2.xz 8.2 |