diff options
Diffstat (limited to 'coin/provisioning/common/unix')
-rwxr-xr-x | coin/provisioning/common/unix/DownloadURL.sh | 50 | ||||
-rwxr-xr-x | coin/provisioning/common/unix/InstallFromCompressedFileFromURL.sh | 3 | ||||
-rw-r--r-- | coin/provisioning/common/unix/common.sourced.sh | 34 | ||||
-rwxr-xr-x | coin/provisioning/common/unix/emsdk.sh | 60 | ||||
-rwxr-xr-x | coin/provisioning/common/unix/install-openssl.sh | 6 | ||||
-rwxr-xr-x | coin/provisioning/common/unix/libclang-v100-dyn.sh | 83 | ||||
-rwxr-xr-x | coin/provisioning/common/unix/libclang.sh | 4 | ||||
-rwxr-xr-x | coin/provisioning/common/unix/python_modules.sh | 38 | ||||
-rwxr-xr-x | coin/provisioning/common/unix/squishInstall.sh | 178 | ||||
-rwxr-xr-x | coin/provisioning/common/unix/telegraf_install.sh | 2 |
10 files changed, 287 insertions, 171 deletions
diff --git a/coin/provisioning/common/unix/DownloadURL.sh b/coin/provisioning/common/unix/DownloadURL.sh index 0579451f..1d48a565 100755 --- a/coin/provisioning/common/unix/DownloadURL.sh +++ b/coin/provisioning/common/unix/DownloadURL.sh @@ -39,10 +39,12 @@ # based on the SHA length). Target filename should also be given. ############################ BOILERPLATE ############################### -command -v sha1sum >/dev/null || alias sha1sum='shasum -a 1' -command -v sha256sum >/dev/null || alias sha256sum='shasum -a 256' -command -v sha384sum >/dev/null || alias sha384sum='shasum -a 384' -command -v sha512sum >/dev/null || alias sha512sum='shasum -a 512' + +command -v sha1sum >/dev/null || sha1sum () { shasum -a 1 "$@" ; } +command -v sha256sum >/dev/null || sha256sum () { shasum -a 256 "$@" ; } +command -v sha384sum >/dev/null || sha384sum () { shasum -a 384 "$@" ; } +command -v sha512sum >/dev/null || sha512sum () { shasum -a 512 "$@" ; } + ######################################################################## @@ -89,22 +91,36 @@ DownloadURL () { url=$1 url2=$2 expectedHash=$3 - targetFile=$4 - - if VerifyHash "$targetFile" "$expectedHash" + # Optional argument $4: destination filename + if [ x"$4" = x ] then - echo "Skipping download, found and validated existing file: $targetFile" + # defaults to the last component of $url + targetFile=$(echo $url | sed 's|^.*/||') else - echo "Downloading from primary URL: $url" - if ! Download "$url" "$targetFile" + targetFile=$4 + fi + + # If a non-empty file already exists + if [ -s "$targetFile" ] + then + if VerifyHash "$targetFile" "$expectedHash" + then + echo "Skipping download, found and validated existing file: $targetFile" + return + else + echo "WARNING: Non-empty but different file found at destination; will re-download and overwrite file: $targetFile" + fi + fi + + echo "Downloading from primary URL: $url" + if ! Download "$url" "$targetFile" + then + echo "FAIL! to download, trying alternative URL: $url2" 1>&2 + if ! Download "$url2" "$targetFile" then - echo "FAIL! to download, trying alternative URL: $url2" 1>&2 - if ! Download "$url" "$targetFile" - then - echo 'FAIL! to download even from alternative url' 1>&2 - return 1 - fi + echo 'FAIL! to download even from alternative URL' 1>&2 + return 1 fi - VerifyHash "$targetFile" "$expectedHash" fi + VerifyHash "$targetFile" "$expectedHash" } diff --git a/coin/provisioning/common/unix/InstallFromCompressedFileFromURL.sh b/coin/provisioning/common/unix/InstallFromCompressedFileFromURL.sh index 34bcf289..8aaa0dc3 100755 --- a/coin/provisioning/common/unix/InstallFromCompressedFileFromURL.sh +++ b/coin/provisioning/common/unix/InstallFromCompressedFileFromURL.sh @@ -67,6 +67,9 @@ function InstallFromCompressedFileFromURL { "xz") tar -xf "$targetFile" --directory "$targetDirectory" ;; + "tbz2") + tar -xjf "$targetFile" --directory "$targetDirectory" + ;; *) exit 1 ;; diff --git a/coin/provisioning/common/unix/common.sourced.sh b/coin/provisioning/common/unix/common.sourced.sh index a52880b2..9f74b32e 100644 --- a/coin/provisioning/common/unix/common.sourced.sh +++ b/coin/provisioning/common/unix/common.sourced.sh @@ -43,6 +43,7 @@ export PROVISIONING_ARCH export CMD_PKG_INSTALL export CMD_PKG_LOCALINSTALL export CMD_INSTALL +export COIN_RUNS_IN_QT_COMPANY @@ -65,8 +66,10 @@ fatal () { fi } +# Takes one argument which should be the filename of this script. Returns true +# if the script is being sourced, false if the script is being executed. is_script_executed () { - [ x"$(basename "$0")" = x"$1" ] + [ x"$(basename $(echo "$0" | sed s/^-//))" = x"$1" ] } @@ -74,6 +77,25 @@ is_script_executed common.sourced.sh \ && fatal "Script common.sourced.sh should always be sourced, not executed" +_detect_linux_OS_ID () { + if [ -f /etc/os-release ] + then + . /etc/os-release + PROVISIONING_OS_ID="$ID" + elif [ -f /etc/redhat-release ] + then + case "$(cat /etc/redhat-release)" in + "Red Hat Enterprise Linux"*) + PROVISIONING_OS_ID="rhel" + ;; + "CentOS Linux"*) + PROVISIONING_OS_ID="centos" + ;; + *) fatal "Unknown string in /etc/redhat-release" ;; + esac + fi +} + set_common_environment () { # Unfortunately we can't find the provisioning directory from a sourced # script in a portable way @@ -86,8 +108,7 @@ set_common_environment () { case "$uname_s" in Linux) PROVISIONING_OS=linux - . /etc/os-release - PROVISIONING_OS_ID="$ID" + _detect_linux_OS_ID case "$PROVISIONING_OS_ID" in suse|sles|opensuse*) CMD_PKG_INSTALL="sudo zypper -nq install" @@ -123,6 +144,13 @@ set_common_environment () { esac CMD_INSTALL="sudo install" + + COIN_RUNS_IN_QT_COMPANY=false + if ping -c1 repo-clones.ci.qt.io >/dev/null 2>&1 + then + COIN_RUNS_IN_QT_COMPANY=true + fi + } set_common_environment diff --git a/coin/provisioning/common/unix/emsdk.sh b/coin/provisioning/common/unix/emsdk.sh index acb2483a..a2fda735 100755 --- a/coin/provisioning/common/unix/emsdk.sh +++ b/coin/provisioning/common/unix/emsdk.sh @@ -39,59 +39,55 @@ source "${BASH_SOURCE%/*}/SetEnvVar.sh" # shellcheck source=./DownloadURL.sh source "${BASH_SOURCE%/*}/DownloadURL.sh" -version="1.38.27" -version_node="8.9.1" -urlOfficial="https://s3.amazonaws.com/mozilla-games/emscripten/packages" +version="1.39.8" urlCache="http://ci-files01-hki.intra.qt.io/input/emsdk" targetFolder="/opt/emsdk" -urlEmscriptenCache="$urlCache/emscripten-$version.tar.gz" -urlEmscriptenExternal="https://github.com/kripken/emscripten/archive/$version.tar.gz" -sha1Emscripten="ff9748a8f6b8eaa8192cce9fe2befc801443a161" +# cross-platform emscripten SDK +urlEmscriptenExternal="https://github.com/emscripten-core/emscripten/archive/$version.tar.gz" +urlEmscriptenCache="$urlCache/emscripten.$version.tar.gz" +sha1Emscripten="a593ea3b4ab7e3d57e1232b19a903ccf8f137d2f" +# platform-specific toolchain and node binaries. urls obtained from "emsdk install" if uname -a |grep -q Darwin; then - urlEmscriptenLlvmCache="$urlCache/macos/emscripten-llvm-e$version.tar.gz" - urlEmscriptenLlvmExternal="$urlOfficial/llvm/tag/osx_64bit/emscripten-llvm-e$version.tar.gz" - urlNodeCache="$urlCache/macos/node-v$version_node-darwin-x64.tar.gz" - urlNodeExternal="$urlOfficial/node-v$version_node-darwin-x64.tar.gz" - sha1EmscriptenLlvm="66dffbc44cfcb7bcb1ed0d2658b519276c3077fa" - sha1Node="b9ec6fe9701d385e385886a4b171ba02bb6aead7" - node_js="$targetFolder/node-v$version_node-darwin-x64/bin" + urlWasmBinariesExternal="https://storage.googleapis.com/webassembly/emscripten-releases-builds/mac/9e60f34accb4627d7358223862a7e74291886ab6/wasm-binaries.tbz2" + urlWasmBinariesCache="$urlCache/macos/wasm-binaries.$version.tbz2" + sha1WasmBinaries="aedb30fb07d565c35305af0920ab072ae743895d" + + urlNodeBinariesExternal="https://storage.googleapis.com/webassembly/emscripten-releases-builds/deps/node-v12.9.1-darwin-x64.tar.gz" + urlNodeBinariesCache="$urlCache/mac/node-v12.9.1-darwin-x64.tar.gz" + sha1NodeBinaries="f5976321ded091e70358e406b223f6fd64e35a43" + pathNodeExecutable='node-v12.9.1-darwin-x64/bin/node' else - urlEmscriptenLlvmCache="$urlCache/linux/emscripten-llvm-e$version.tar.gz" - urlEmscriptenLlvmExternal="$urlOfficial/llvm/tag/linux_64bit/emscripten-llvm-e$version.tar.gz" - urlNodeCache="$urlCache/linux/node-v$version_node-linux-x64.tar.xz" - urlNodeExternal="$urlOfficial/node-v$version_node-linux-x64.tar.xz" - sha1EmscriptenLlvm="8f5cd026c98cd40e53e6d11fbc32b116280ef9bb" - sha1Node="eaec5de2af934f7ebc7f9597983e71c5d5a9a726" - node_js="$targetFolder/node-v$version_node-linux-x64/bin" + urlWasmBinariesExternal="https://storage.googleapis.com/webassembly/emscripten-releases-builds/linux/9e60f34accb4627d7358223862a7e74291886ab6/wasm-binaries.tbz2" + urlWasmBinariesCache="$urlCache/linux/wasm-binaries.$version.tbz2" + sha1WasmBinaries="eb7fc94aa79a6e215272e2586173515aa37c3141" + + urlNodeBinariesExternal="https://storage.googleapis.com/webassembly/emscripten-releases-builds/deps/node-v12.9.1-linux-x64.tar.xz" + urlNodeBinariesCache="$urlCache/linux/node-v12.9.1-linux-x64.tar.xz" + sha1NodeBinaries="cde96023b468d593c50de27470dd714c8cfda9aa" + pathNodeExecutable='node-v12.9.1-linux-x64/bin/node' fi sudo mkdir "$targetFolder" InstallFromCompressedFileFromURL "$urlEmscriptenCache" "$urlEmscriptenExternal" "$sha1Emscripten" "$targetFolder" "" -InstallFromCompressedFileFromURL "$urlEmscriptenLlvmCache" "$urlEmscriptenLlvmExternal" "$sha1EmscriptenLlvm" "$targetFolder" "" -InstallFromCompressedFileFromURL "$urlNodeCache" "$urlNodeExternal" "$sha1Node" "$targetFolder" "" +InstallFromCompressedFileFromURL "$urlWasmBinariesCache" "$urlWasmBinariesExternal" "$sha1WasmBinaries" "$targetFolder" "" +InstallFromCompressedFileFromURL "$urlNodeBinariesCache" "$urlNodeBinariesExternal" "$sha1NodeBinaries" "$targetFolder" "" sudo chmod -R a+rwx "$targetFolder" echo "Writing $targetFolder/.emscripten" cat <<EOM >"$targetFolder/.emscripten" -LLVM_ROOT='$targetFolder/emscripten-llvm-e$version/' -EMSCRIPTEN_NATIVE_OPTIMIZER='$targetFolder/emscripten-llvm-e$version/optimizer' -BINARYEN_ROOT='$targetFolder/emscripten-llvm-e$version/binaryen' -NODE_JS='$node_js/node' EMSCRIPTEN_ROOT='$targetFolder/emscripten-$version' -SPIDERMONKEY_ENGINE = '' -V8_ENGINE = '' +LLVM_ROOT='$targetFolder/install/bin' +BINARYEN_ROOT='$targetFolder/install' +NODE_JS='$targetFolder/$pathNodeExecutable' TEMP_DIR = '/tmp' -COMPILER_ENGINE = NODE_JS -JS_ENGINES = [NODE_JS] EOM -SetEnvVar "PATH" "\"\$PATH:$targetFolder/emscripten-llvm-e$version/:$node_js:$targetFolder/emscripten-$version\"" +SetEnvVar "PATH" "\"\$PATH:$targetFolder/emscripten-$version/\"" SetEnvVar "EMSCRIPTEN" "$targetFolder/emscripten-$version" SetEnvVar "EM_CONFIG" "$targetFolder/.emscripten" echo "Emsdk = $version" >> ~/versions.txt -echo "Emsdk node = $version_node" >> ~/versions.txt diff --git a/coin/provisioning/common/unix/install-openssl.sh b/coin/provisioning/common/unix/install-openssl.sh index 01a20935..75b7edbc 100755 --- a/coin/provisioning/common/unix/install-openssl.sh +++ b/coin/provisioning/common/unix/install-openssl.sh @@ -2,7 +2,7 @@ ############################################################################# ## -## Copyright (C) 2019 The Qt Company Ltd. +## Copyright (C) 2020 The Qt Company Ltd. ## Contact: http://www.qt.io/licensing/ ## ## This file is part of the provisioning scripts of the Qt Toolkit. @@ -42,11 +42,11 @@ source "${BASH_SOURCE%/*}/../unix/DownloadURL.sh" # shellcheck source=../unix/SetEnvVar.sh source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh" -version="1.1.1b" +version="1.1.1g" officialUrl="https://www.openssl.org/source/openssl-$version.tar.gz" cachedUrl="http://ci-files01-hki.intra.qt.io/input/openssl/openssl-$version.tar.gz" targetFile="/tmp/openssl-$version.tar.gz" -sha="e9710abf5e95c48ebf47991b10cbb48c09dae102" +sha="b213a293f2127ec3e323fb3cfc0c9807664fd997" opensslHome="${HOME}/openssl-${version}" opensslSource="${opensslHome}-src" DownloadURL "$cachedUrl" "$officialUrl" "$sha" "$targetFile" diff --git a/coin/provisioning/common/unix/libclang-v100-dyn.sh b/coin/provisioning/common/unix/libclang-v100-dyn.sh new file mode 100755 index 00000000..d6609429 --- /dev/null +++ b/coin/provisioning/common/unix/libclang-v100-dyn.sh @@ -0,0 +1,83 @@ +#!/usr/bin/env bash + +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: http://www.qt.io/licensing/ +## +## This file is part of the provisioning scripts of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:LGPL21$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see http://www.qt.io/terms-conditions. For further +## information use the contact form at http://www.qt.io/contact-us. +## +## GNU Lesser General Public License Usage +## Alternatively, this file may be used under the terms of the GNU Lesser +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +## +## As a special exception, The Qt Company gives you certain additional +## rights. These rights are described in The Qt Company LGPL Exception +## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +## +## $QT_END_LICENSE$ +## +############################################################################# + +# PySide versions following 5.6 use a C++ parser based on Clang (http://clang.org/). +# The Clang library (C-bindings), version 3.9 or higher is required for building. + +# This same script is used to provision libclang to Linux and macOS. +# In case of Linux, we expect to get the values as args +set -e + +# shellcheck source=./check_and_set_proxy.sh +source "${BASH_SOURCE%/*}/check_and_set_proxy.sh" +# shellcheck source=./SetEnvVar.sh +source "${BASH_SOURCE%/*}/SetEnvVar.sh" +# shellcheck source=./DownloadURL.sh +source "${BASH_SOURCE%/*}/DownloadURL.sh" + +libclang_version=10.0 + +if uname -a |grep -q Darwin; then + version=$libclang_version + url="https://download.qt.io/development_releases/prebuilt/libclang/libclang-release_${version//\./}-based-mac.7z" + sha1="0fe1fa50b1b469d2c05acc3a3468bc93a66f1e5a" + url_cached="http://ci-files01-hki.intra.qt.io/input/libclang/qt/libclang-release_${version//\./}-based-mac.7z" +elif test -f /etc/redhat-release || /etc/centos-release; then + version=$libclang_version + url="https://download.qt.io/development_releases/prebuilt/libclang/libclang-release_${version//\./}-based-linux-Rhel7.6-gcc5.3-x86_64.7z" + sha1="1d2e265502fc0832a854f989d757105833fbd179" + url_cached="http://ci-files01-hki.intra.qt.io/input/libclang/libclang-release_${version//\./}-based-linux-Rhel7.6-gcc5.3-x86_64.7z" +else + version=$libclang_version + url="https://download.qt.io/development_releases/prebuilt/libclang/libclang-release_${version//\./}-based-linux-Ubuntu18.04-gcc9.2-x86_64.7z" + sha1="c1580acb3a82e193acf86f18afb52427c5e67de8" + url_cached="http://ci-files01-hki.intra.qt.io/input/libclang/libclang-release_${version//\./}-based-linux-Ubuntu18.04-gcc9.2-x86_64.7z" +fi + +zip="/tmp/libclang.7z" +destination="/usr/local/libclang-dynlibs-$version" + +DownloadURL $url_cached $url $sha1 $zip +if command -v 7zr &> /dev/null; then + sudo 7zr x $zip -o/usr/local/ +else + sudo 7z x $zip -o/usr/local/ +fi +sudo mv /usr/local/libclang "$destination" +rm -rf $zip + + +echo "export LLVM_DYNAMIC_LIBS_100=$destination" >> ~/.bash_profile +echo "libClang for QtForPython= $version" >> ~/versions.txt diff --git a/coin/provisioning/common/unix/libclang.sh b/coin/provisioning/common/unix/libclang.sh index a9d1cc49..6fa6c040 100755 --- a/coin/provisioning/common/unix/libclang.sh +++ b/coin/provisioning/common/unix/libclang.sh @@ -65,10 +65,10 @@ zip="/tmp/libclang.7z" destination="/usr/local/libclang-$version" DownloadURL $url_cached $url $sha1 $zip -7z x $zip -o/tmp/ +sudo 7z x $zip -o/usr/local/ +sudo mv /usr/local/libclang "$destination" rm -rf $zip -sudo mv /tmp/libclang "$destination" echo "export LLVM_INSTALL_DIR=$destination" >> ~/.bash_profile echo "libClang = $version" >> ~/versions.txt diff --git a/coin/provisioning/common/unix/python_modules.sh b/coin/provisioning/common/unix/python_modules.sh new file mode 100755 index 00000000..89adbd5c --- /dev/null +++ b/coin/provisioning/common/unix/python_modules.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +############################################################################# +## +## Copyright (C) 2019 The Qt Company Ltd. +## Contact: http://www.qt.io/licensing/ +## +## This file is part of the provisioning scripts of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:LGPL21$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see http://www.qt.io/terms-conditions. For further +## information use the contact form at http://www.qt.io/contact-us. +## +## GNU Lesser General Public License Usage +## Alternatively, this file may be used under the terms of the GNU Lesser +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +## +## As a special exception, The Qt Company gives you certain additional +## rights. These rights are described in The Qt Company LGPL Exception +## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +## +## $QT_END_LICENSE$ +## +############################################################################# + +# needed by packaging scripts +pip3 install bs4 +pip3 install sh diff --git a/coin/provisioning/common/unix/squishInstall.sh b/coin/provisioning/common/unix/squishInstall.sh index f1b5e6b5..bce68549 100755 --- a/coin/provisioning/common/unix/squishInstall.sh +++ b/coin/provisioning/common/unix/squishInstall.sh @@ -2,7 +2,7 @@ ############################################################################# ## -## Copyright (C) 2017 The Qt Company Ltd. +## Copyright (C) 2020 The Qt Company Ltd. ## Contact: http://www.qt.io/licensing/ ## ## This file is part of the provisioning scripts of the Qt Toolkit. @@ -33,141 +33,93 @@ ## ############################################################################# +# shellcheck source=./DownloadURL.sh +source "${BASH_SOURCE%/*}/DownloadURL.sh" + set -ex -# This script will install squish package for Linux and Mac. +# This script will fetch and extract pre-buildt squish package for Linux and Mac. # Squish is need by Release Test Automation (RTA) -version="6.4.3" -# Branch version without dot -qtBranch="512x" -squishFolder="/opt/squish" -squishUrl="ci-files01-hki.intra.qt.io:/hdd/www/input/squish/coin/$qtBranch/" -squishFile="squish-$version-qt$qtBranch-linux64.run" +version="6.6.1" +qtBranch="515x" +installFolder="/opt" +squishFolder="$installFolder/squish" +preBuildCacheUrl="ci-files01-hki.intra.qt.io:/hdd/www/input/squish/jenkins_build/stable" +licenseUrl="http://ci-files01-hki.intra.qt.io/input/squish/coin/$qtBranch/.squish-3-license" +licenseSHA="e000d2f95b30b82f405b9dcbeb233cd43710a41a" if uname -a |grep -q Darwin; then - squishFile="squish-$version-qt$qtBranch-macx86_64.dmg" + compressedFolder="prebuild-squish-$version-$qtBranch-macx86_64.tar.gz" + sha1="9fff9a7cb037214d21f47f2cc53747885fd1f2ae" +else + compressedFolder="prebuild-squish-$version-$qtBranch-linux64.tar.gz" + sha1="3a50052caafa3ca583b7edf754227999d7185ffa" fi -squishLicenseUrl="ci-files01-hki.intra.qt.io:/hdd/www/input/squish/coin/" -squishLicenseFile=".squish-3-license.tar.gz" - -testSuite="suite_test_squish" -testSuiteUrl="ci-files01-hki.intra.qt.io:/hdd/www/input/squish/coin/" +mountFolder="/tmp/squish" +sudo mkdir "$mountFolder" -# These checks can be removed when Vanilla OS for all linux and Mac are in -if [ -d "$squishFolder" ]; then - echo "Move old squish to /tmp" - sudo mv "$squishFolder" "/tmp/squish_$(date)" +# Check which platform +if uname -a |grep -q Darwin; then + usersGroup="staff" + squishLicenseDir="/Users/qt" +elif uname -a |grep -q "el7"; then + usersGroup="qt" + squishLicenseDir="/root" +elif uname -a |grep -q "Ubuntu"; then + usersGroup="users" + squishLicenseDir="/home/qt" +else + usersGroup="users" + squishLicenseDir="/root" fi -if [ -f "/etc/profile.d/squish_env.sh" ]; then - echo "Remove /etc/profile.d/squish_env.sh" - sudo rm -f "/etc/profile.d/squish_env.sh" - export SQUISH_LICENSEKEY_DIR=$HOME +targetFileMount="$mountFolder"/"$compressedFolder" + +echo "Mounting $preBuildCacheUrl to $mountFolder" +sudo mount "$preBuildCacheUrl" "$mountFolder" +echo "Create $installFolder if needed" +if [ ! -d "$installFolder" ]; then + sudo mkdir "$installFolder" fi -function MountAndInstall { - url=$1 - targetDirectory=$2 - targetFile=$3 - - # Check which platform - if uname -a |grep -q Darwin; then - usersGroup="staff" - mountFolder="/Volumes" - squishLicenseDir="/Users/qt" - elif uname -a |grep -q "el7"; then - usersGroup="qt" - mountFolder="/tmp" - squishLicenseDir="/root" - elif uname -a |grep -q "Ubuntu"; then - usersGroup="users" - mountFolder="/tmp" - squishLicenseDir="/home/qt" - else - usersGroup="users" - mountFolder="/tmp" - squishLicenseDir="/root" - fi +VerifyHash "$targetFileMount" "$sha1" - function UnMount { - echo "Unmounting $mountFolder" - sudo diskutil unmount force "$mountFolder" || sudo umount -f "$mountFolder" - } +echo "Uncompress $compressedFolder" +sudo tar -xzf "$targetFileMount" --directory "$installFolder" - targetFileMount="$mountFolder"/"$targetFile" +echo "Unmounting $mountFolder" +sudo diskutil unmount force "$mountFolder" || sudo umount -f "$mountFolder" - echo "Mounting $url to $mountFolder" - sudo mount "$url" "$mountFolder" - echo "Create $targetDirectory if needed" - if [ ! -d "/opt" ]; then - sudo mkdir "/opt" - fi - if [ ! -d "$targetDirectory" ]; then - sudo mkdir "$targetDirectory" - fi - echo "Uncompress $targetFile" - if [[ $targetFile == *.tar.gz ]]; then - if [[ $targetFile == .squish-3-license.* ]]; then - target="$squishLicenseDir" - # Squish license need to be exists also in users home directory, because squish check it before it starts running tests - sudo tar -xzf "$targetFileMount" --directory "$HOME" - else - target="$targetDirectory" - fi - sudo tar -xzf "$targetFileMount" --directory "$target" - UnMount - elif [[ $targetFile == *.dmg ]]; then - echo "'dmg-file', no need to uncompress" - sudo cp $targetFileMount /tmp - UnMount - sudo hdiutil attach "/tmp/$targetFile" - sudo /Volumes/froglogic\ Squish/Install\ Squish.app/Contents/MacOS/Squish unattended=1 targetdir="$targetDirectory/package" qtpath="$targetDirectory" > /dev/null - mountFolder="/Volumes/froglogic Squish" - UnMount - elif [[ $targetFile == *.run ]]; then - echo "'run-file', no need to uncompress" - sudo cp $targetFileMount $targetDirectory - UnMount - sudo chmod +x $targetDirectory/$targetFile - sudo $targetDirectory/$targetFile unattended=1 targetdir="$targetDirectory/package" qtpath="$targetDirectory" > /dev/null - sudo rm -fr "$targetDirectory/$targetFile" - if uname -a |grep -q "Ubuntu"; then - sudo mkdir /usr/lib/tcl8.6 - sudo cp "$targetDirectory/package/tcl/lib/tcl8.6/init.tcl" /usr/lib/tcl8.6/ - fi - else - exit 1 +sudo mv "$installFolder/rta_squish_$version" "$squishFolder" + +if uname -a |grep -q "Ubuntu"; then + if [ ! -e "/usr/lib/tcl8.6" ]; then + sudo mkdir /usr/lib/tcl8.6 + sudo cp "$squishFolder/squish_for_qt/tcl/lib/tcl8.6/init.tcl" /usr/lib/tcl8.6/ fi +fi - echo "Changing ownerships" - sudo chown -R qt:$usersGroup "$targetDirectory" - sudo chown qt:$usersGroup "$HOME/.squish-3-license" -} +DownloadURL "$licenseUrl" "$licenseUrl" "$licenseSHA" "$HOME/.squish-3-license" -echo "Set commands for environment variables in .bashrc" +echo "Changing ownerships" +sudo chown -R qt:$usersGroup "$squishFolder" +sudo chown qt:$usersGroup "$HOME/.squish-3-license" +echo "Set commands for environment variables in .bashrc" if uname -a |grep -q "Ubuntu"; then - echo "export SQUISH_PATH=$squishFolder/package" >> ~/.profile - echo "export PATH=\$PATH:$squishFolder/squish-$version/bin" >> ~/.profile + echo "export SQUISH_PATH=$squishFolder/squish_for_qt" >> ~/.profile + echo "export PATH=\$PATH:$squishFolder/squish_for_qt/bin" >> ~/.profile else - echo "export SQUISH_PATH=$squishFolder/package" >> ~/.bashrc - echo "export PATH=\$PATH:$squishFolder/squish-$version/bin" >> ~/.bashrc + echo "export SQUISH_PATH=$squishFolder/squish_for_qt" >> ~/.bashrc + echo "export PATH=\$PATH:$squishFolder/squish_for_qt/bin" >> ~/.bashrc fi -echo "Installing squish license to home directory.." -MountAndInstall "$squishLicenseUrl" "$squishFolder" "$squishLicenseFile" - -echo "Installing squish $version.." -MountAndInstall "$squishUrl" "$squishFolder" "$squishFile" - -echo "Installing provisioning scripts for squish" -MountAndInstall "$testSuiteUrl" "$squishFolder" "$testSuite.tar.gz" - -echo "Verifying Squish Installation" -if "$squishFolder/package/bin/squishrunner" --testsuite "$squishFolder/$testSuite" | grep "Squish test run successfully" ; then - echo "Squish installation tested successfully" +echo "Verifying Squish" +if "$squishFolder/squish_for_qt/bin/squishrunner" --testsuite "$squishFolder/suite_test_squish" | grep "Squish test run successfully" ; then + echo "Squish for Qt installation tested successfully" else - echo "Squish test failed! Package wasn't installed correctly." + echo "Squish for Qt test failed! Package wasn't installed correctly." exit 1 fi + diff --git a/coin/provisioning/common/unix/telegraf_install.sh b/coin/provisioning/common/unix/telegraf_install.sh index 1412650e..b2dd244e 100755 --- a/coin/provisioning/common/unix/telegraf_install.sh +++ b/coin/provisioning/common/unix/telegraf_install.sh @@ -73,7 +73,7 @@ $CMD_INSTALL -m 755 "$PROVISIONING_DIR"/common/shared/telegraf/telegraf-ioping. [ x"$PROVISIONING_OS" = xmacos ] && os=darwin || os=linux [ x"$PROVISIONING_ARCH" = xx86 ] && arch=i386 || arch=amd64 -package_filename=telegraf-1.12.1_${os}_${arch}.tar.gz +package_filename=telegraf-1.12.6_${os}_${arch}.tar.gz package_sha256_list="$PROVISIONING_DIR"/common/shared/telegraf/telegraf_packages.sha256.txt package_sha256=$(sed -n "s/.*$package_filename *//p" "$package_sha256_list") |