aboutsummaryrefslogtreecommitdiffstats
path: root/coin/provisioning/common
diff options
context:
space:
mode:
Diffstat (limited to 'coin/provisioning/common')
-rw-r--r--coin/provisioning/common/03-conan.ps12
-rw-r--r--coin/provisioning/common/InstallAppFromCompressedFileFromURL.sh127
-rw-r--r--coin/provisioning/common/InstallPKGFromURL.sh103
-rw-r--r--coin/provisioning/common/helpers.ps123
-rw-r--r--coin/provisioning/common/jom.ps16
-rw-r--r--coin/provisioning/common/libusb.ps147
-rwxr-xr-xcoin/provisioning/common/linux-removethemall.sh49
-rw-r--r--coin/provisioning/common/msvc2015_update.ps158
-rwxr-xr-xcoin/provisioning/common/version.sh43
9 files changed, 454 insertions, 4 deletions
diff --git a/coin/provisioning/common/03-conan.ps1 b/coin/provisioning/common/03-conan.ps1
index 04be729d..6a4b4ebb 100644
--- a/coin/provisioning/common/03-conan.ps1
+++ b/coin/provisioning/common/03-conan.ps1
@@ -2,7 +2,7 @@
$scriptsPath = "C:\Python27\Scripts"
-& "$scriptsPath\pip.exe" install --upgrade conan==0.16.0
+& "$scriptsPath\pip.exe" install --upgrade conan==0.20.2
[Environment]::SetEnvironmentVariable("CI_CONAN_BUILDINFO_DIR", "C:\Utils\conanbuildinfos", "Machine")
diff --git a/coin/provisioning/common/InstallAppFromCompressedFileFromURL.sh b/coin/provisioning/common/InstallAppFromCompressedFileFromURL.sh
new file mode 100644
index 00000000..b6072062
--- /dev/null
+++ b/coin/provisioning/common/InstallAppFromCompressedFileFromURL.sh
@@ -0,0 +1,127 @@
+#!/bin/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$
+##
+#############################################################################
+
+# This script receives URLs to a compressed file. It then downloads it,
+# uncompresses it and installs it by default
+# to /Applications/. This can be overridden by a target parameter.
+
+# shellcheck source=try_catch.sh
+source "${BASH_SOURCE%/*}/try_catch.sh"
+# shellcheck source=DownloadURL.sh
+source "${BASH_SOURCE%/*}/DownloadURL.sh"
+
+ExceptionCreateTmpFile=100
+ExceptionCreateTmpDirectory=101
+ExceptionUncompress=102
+ExceptionMoveApp=103
+ExceptionDeleteTmpFile=104
+ExceptionRemoveTmpDirectory=105
+ExceptionUnknownFormat=106
+
+
+function InstallAppFromCompressedFileFromURL {
+ url=$1
+ url_alt=$2
+ expectedSha1=$3
+ appPrefix=$4
+ target=$5
+
+ if [ "" == "$target" ]; then
+ target="/Applications/"
+ fi
+
+ try
+ (
+ basefilename=${url##*/}
+ extension=${basefilename##*.}
+ filename=${basefilename%.*}
+ if [ "$extension" == "gz" ] && [ "${filename##*.}" == "tar" ]; then
+ extension="tar.gz"
+ fi
+
+ echo "Extension for file: $extension"
+ echo "Creating temporary file and directory"
+ targetFile=$(mktemp "$TMPDIR$(uuidgen).$extension") || throw $ExceptionCreateTmpFile
+ targetDirectory=$(mktemp -d) || throw $ExceptionCreateTmpDirectory
+ DownloadURL "$url" "$url_alt" "$expectedSha1" "$targetFile"
+ echo "Uncompress $targetFile"
+ case $extension in
+ "tar.gz")
+ tar -xzf "$targetFile" --directory "$targetDirectory" || throw $ExceptionUncompress
+ ;;
+ "zip")
+ unzip "$targetFile" -d "$targetDirectory" || throw $ExceptionUncompress
+ ;;
+ *)
+ throw $ExceptionUnknownFormat
+ ;;
+ esac
+ echo "Moving app to '$target'"
+ sudo mv "$targetDirectory/$appPrefix/"* "$target" || throw $ExceptionMoveApp
+ echo "Removing file '$targetFile'"
+ rm "$targetFile" || throw $ExceptionDeleteTmpFile
+ echo "Removing directory '$targetDirectory'"
+ rm -rf "$targetDirectory" || throw $ExceptionRemoveTmpDirectory
+ )
+
+ catch || {
+ case $ex_code in
+ $ExceptionCreateTmpFile)
+ echo "Failed to create temporary file"
+ exit 1;
+ ;;
+ $ExceptionUncompress)
+ echo "Failed extracting compressed file."
+ exit 1;
+ ;;
+ $ExceptionMoveApp)
+ echo "Failed moving app to '$target'."
+ exit 1;
+ ;;
+ $ExceptionDeleteTmpFile)
+ echo "Failed deleting temporary file."
+ exit 1;
+ ;;
+ $ExceptionRemoveTmpDirectory)
+ echo "Failed deleting temporary file."
+ exit 1;
+ ;;
+ $ExceptionUnknownFormat)
+ echo "Unknown file format."
+ exit 1;
+ ;;
+ esac
+ }
+}
diff --git a/coin/provisioning/common/InstallPKGFromURL.sh b/coin/provisioning/common/InstallPKGFromURL.sh
new file mode 100644
index 00000000..07f23d62
--- /dev/null
+++ b/coin/provisioning/common/InstallPKGFromURL.sh
@@ -0,0 +1,103 @@
+#!/bin/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$
+##
+#############################################################################
+
+# shellcheck source=try_catch.sh
+source "${BASH_SOURCE%/*}/try_catch.sh"
+
+ExceptionCreateTmpFile=100
+ExceptionDownloadPrimaryUrl=101
+ExceptionDownloadAltUrl=102
+ExceptionSHA1=103
+ExceptionInstallerPKG=104
+ExceptionDeleteTmpFile=105
+
+
+function InstallPKGFromURL {
+ url=$1
+ url_alt=$2
+ expectedSha1=$3
+ targetDirectory=$4
+
+ try
+ (
+ echo "Creating temporary file"
+ targetFile=$(mktemp "$TMPDIR$(uuidgen).pkg") || trow $ExceptionCreateTmpFile
+ try
+ (
+ echo "Downloading PKG from primary URL '$url'"
+ curl --fail -L --retry 5 --retry-delay 5 -o "$targetFile" "$url" || throw $ExceptionDownloadPrimaryUrl
+ )
+ catch || {
+ case $ex_code in
+ $ExceptionDownloadPrimaryUrl)
+ echo "Failed to download '$url' multiple times"
+ echo "Downloading PKG from alternative URL '$url_alt'"
+ curl --fail -L --retry 5 --retry-delay 5 -o "$targetFile" "$url_alt" || throw $ExceptionDownloadAltUrl
+ ;;
+ esac
+ }
+ echo "Checking SHA1 on PKG '$targetFile'"
+ echo "$expectedSha1 *$targetFile" | shasum --check || throw $ExceptionSHA1
+ echo "Run installer on PKG"
+ sudo installer -package "$targetFile" -target "$targetDirectory" || throw $ExceptionInstallerPKG
+ echo "Removing file '$targetFile'"
+ rm "$targetFile" || throw $ExceptionDeleteTmpFile
+ )
+
+ catch || {
+ case $ex_code in
+ $ExceptionCreateTmpFile)
+ echo "Failed to create temporary file"
+ exit 1;
+ ;;
+ $ExceptionDownloadAltUrl)
+ echo "Failed downloading PKG from primary and alternative URLs"
+ exit 1;
+ ;;
+ $ExceptionSHA1)
+ echo "Failed to check sha1sum."
+ exit 1;
+ ;;
+ $ExceptionInstallerPKG)
+ echo "Failed running installer on PKG."
+ exit 1;
+ ;;
+ $ExceptionDeleteTmpFile)
+ echo "Failed deleting temporary file."
+ exit 1;
+ ;;
+ esac
+ }
+}
diff --git a/coin/provisioning/common/helpers.ps1 b/coin/provisioning/common/helpers.ps1
index 0e684452..191be290 100644
--- a/coin/provisioning/common/helpers.ps1
+++ b/coin/provisioning/common/helpers.ps1
@@ -15,6 +15,29 @@ function Verify-Checksum
}
}
+function Extract-7Zip
+{
+ Param (
+ [string]$Source,
+ [string]$Destination
+ )
+ echo "Extracting '$Source' to '$Destination'..."
+
+ if ((Get-Command "7z.exe" -ErrorAction SilentlyContinue) -eq $null) {
+ $zipExe = join-path ${env:ProgramFiles(x86)} '7-zip\7z.exe'
+ if (-not (test-path $zipExe)) {
+ $zipExe = join-path ${env:ProgramW6432} '7-zip\7z.exe'
+ if (-not (test-path $zipExe)) {
+ throw "Could not find 7-zip."
+ }
+ }
+ } else {
+ $zipExe = "7z.exe"
+ }
+
+ & $zipExe x $Source "-o$Destination" -y
+}
+
function Extract-Zip
{
Param (
diff --git a/coin/provisioning/common/jom.ps1 b/coin/provisioning/common/jom.ps1
index ef012b64..c1e2cbf7 100644
--- a/coin/provisioning/common/jom.ps1
+++ b/coin/provisioning/common/jom.ps1
@@ -1,9 +1,9 @@
. "$PSScriptRoot\helpers.ps1"
-$zip = "c:\users\qt\downloads\jom_1_1_0.zip"
+$zip = "c:\users\qt\downloads\jom_1_1_2.zip"
-Invoke-WebRequest -UseBasicParsing http://download.qt.io/official_releases/jom/jom_1_1_0.zip -OutFile $zip
-Verify-Checksum $zip "C4149FE706B25738B4C4E54C73E180B9CAB55832"
+Invoke-WebRequest -UseBasicParsing http://download.qt.io/official_releases/jom/jom_1_1_2.zip -OutFile $zip
+Verify-Checksum $zip "80EE5678E714DE99DDAF5F7593AB04DB1C7928E4"
Extract-Zip $zip C:\Utils\Jom
[Environment]::SetEnvironmentVariable("CI_JOM_PATH", "C:\Utils\Jom", "Machine")
diff --git a/coin/provisioning/common/libusb.ps1 b/coin/provisioning/common/libusb.ps1
new file mode 100644
index 00000000..ed575886
--- /dev/null
+++ b/coin/provisioning/common/libusb.ps1
@@ -0,0 +1,47 @@
+#############################################################################
+#
+# 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$
+#
+############################################################################
+
+# lisbusb-1.0 is needed by tqtc-boot2qt/qdb
+
+. "$PSScriptRoot\helpers.ps1"
+
+$archive = "C:\users\qt\downloads\libusb-1.0.21.7z"
+$libusb_location = "C:\Utils\libusb-1.0"
+
+Download https://vorboss.dl.sourceforge.net/project/libusb/libusb-1.0/libusb-1.0.21/libusb-1.0.21.7z http://ci-files01-hki.ci.local/input/libusb-1.0/libusb-1.0.21.7z $archive
+Verify-Checksum $archive "37c8884a0ddca97d492b8ef3e08970ae3ba20653"
+
+Extract-7Zip $archive $libusb_location
+
+# Tell tqtc-boot2qt/qdb build system where to find libusb
+[Environment]::SetEnvironmentVariable("LIBUSB_PATH", $libusb_location, "Machine")
diff --git a/coin/provisioning/common/linux-removethemall.sh b/coin/provisioning/common/linux-removethemall.sh
new file mode 100755
index 00000000..4386ec74
--- /dev/null
+++ b/coin/provisioning/common/linux-removethemall.sh
@@ -0,0 +1,49 @@
+#!/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$
+##
+#############################################################################
+
+# This script removes preinstalled sw.
+# NOTE! Make sure that ALL software which are removed here have provision script under platrom folders which calls this script
+
+function RemoveDir {
+ targetFolder=$1
+
+ if [ -d "$targetFolder" ]; then
+ echo "Removing existing $targetFolder..."
+ sudo rm -fr "$targetFolder"
+ fi
+}
+
+# Android
+RemoveDir /opt/android
diff --git a/coin/provisioning/common/msvc2015_update.ps1 b/coin/provisioning/common/msvc2015_update.ps1
new file mode 100644
index 00000000..618c87c4
--- /dev/null
+++ b/coin/provisioning/common/msvc2015_update.ps1
@@ -0,0 +1,58 @@
+#############################################################################
+##
+## 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$
+##
+#############################################################################
+. "$PSScriptRoot\helpers.ps1"
+
+# Install Visual Studio $version with $update_version
+# Original download page: https://www.visualstudio.com/en-us/news/releasenotes/vs2015-update3-vs
+$version = "2015"
+$update_version = "3"
+
+# Only way to install specific Visual studio release is to use feed.xml.
+# Visual Studio $version setup will use the feed.xml that was available when $update_version released -> 'https://msdn.microsoft.com/en-us/library/mt653628.aspx'
+# These parameters will install Visual Studio Enterprise Update $update_version (the original Update $update_version without any further Update $update_version-era updates)
+$parameters = "/OverrideFeedURI http://download.microsoft.com/download/6/B/B/6BBD3561-D764-4F39-AB8E-05356A122545/20160628.2/enu/feed.xml"
+
+$msvc_web_installer = "vs" + $version + "_" + $update_version
+$package = "C:\Windows\temp\$msvc_web_installer.exe"
+$url_cache = "http://ci-files01-hki.ci.local/input/windows/$msvc_web_installer.exe"
+$url_official = "https://go.microsoft.com/fwlink/?LinkId=691129"
+$sha1 = "68abf90424aff604a04d6c61fb52adcd2cab2266"
+
+echo "Fetching Visual Studio $version update $update_version..."
+Download $url_official $url_cache $package
+Verify-Checksum $package $sha1
+echo "Installing Visual studio $version update $update_version..."
+cmd /c "$package $parameters /norestart /Quiet"
+remove-item $package
+
+echo "Visual Studio = $version update $update_version" >> ~\versions.txt
diff --git a/coin/provisioning/common/version.sh b/coin/provisioning/common/version.sh
new file mode 100755
index 00000000..e7662e1e
--- /dev/null
+++ b/coin/provisioning/common/version.sh
@@ -0,0 +1,43 @@
+#!/bin/env bash
+
+#############################################################################
+##
+## Copyright (C) 2016 The Qt Company Ltd.
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the test suite 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$
+##
+#############################################################################
+
+# This script will print all installed software to provision log.
+# Script needs to be named so that it will be ran at last during provisioning
+
+# Print all build machines versions to provision log
+echo "*********************************************"
+echo "***** SW VERSIONS *****"
+cat ~/versions.txt
+echo "*********************************************"