Skip to content

Commit

Permalink
Fix shellcheck complaints from provisioning scripts
Browse files Browse the repository at this point in the history
Change-Id: I8d1ee4241d7e99269e8c717ceb2aecde3194c51a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
  • Loading branch information
Tony Sarajärvi committed Apr 1, 2019
1 parent f678ae3 commit b2afcc8
Show file tree
Hide file tree
Showing 60 changed files with 93 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ sudo pip install virtualenv wheel

sudo /usr/local/bin/pip3 install wheel
# Install all needed packages in a special wheel cache directory
/usr/local/bin/pip3 wheel --wheel-dir $HOME/python3-wheels -r ${BASH_SOURCE%/*}/../common/shared/requirements.txt
/usr/local/bin/pip3 wheel --wheel-dir "$HOME/python3-wheels" -r "${BASH_SOURCE%/*}/../common/shared/requirements.txt"

# shellcheck source=../common/unix/SetEnvVar.sh
source "${BASH_SOURCE%/*}/../common/unix/SetEnvVar.sh"
SetEnvVar "PYTHON3_WHEEL_CACHE" "$HOME/python3-wheels"
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

set -ex

# shellcheck source=../common/unix/check_and_set_proxy.sh
source "${BASH_SOURCE%/*}/../common/unix/check_and_set_proxy.sh"

NTS_IP=10.212.2.216
Expand Down
5 changes: 3 additions & 2 deletions coin/provisioning/qtci-linux-Ubuntu-16.04-x86_64/02-apt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ for service in apt-daily.timer apt-daily-upgrade.timer apt-daily.service apt-dai
done

# aptdaemon is used by update notifiers and similar and there is no point in having those (the symptom is aptd holding a lock)
for i in `seq 10`; do
for i in $(seq 10); do
echo attempting to remove aptdaemon
sudo DEBIAN_FRONTEND=noninteractive apt-get -q -y remove aptdaemon || true
# check that aptdaemon is no longer installed
Expand Down Expand Up @@ -178,7 +178,8 @@ echo "Installing packages"
sudo DEBIAN_FRONTEND=noninteractive apt-get -q -y install "${installPackages[@]}"

# Install all needed packages in a special wheel cache directory
pip3 wheel --wheel-dir $HOME/python3-wheels -r ${BASH_SOURCE%/*}/../common/shared/requirements.txt
pip3 wheel --wheel-dir "$HOME/python3-wheels" -r "${BASH_SOURCE%/*}/../common/shared/requirements.txt"

# shellcheck source=../common/unix/SetEnvVar.sh
source "${BASH_SOURCE%/*}/../common/unix/SetEnvVar.sh"
SetEnvVar "PYTHON3_WHEEL_CACHE" "$HOME/python3-wheels"
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash

# shellcheck source=../common/linux/disable-ntp_linux.sh
source "${BASH_SOURCE%/*}/../common/linux/disable-ntp_linux.sh"
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@
##
#############################################################################

set -ex

# shellcheck source=../common/unix/mqtt_broker.sh
source "${BASH_SOURCE%/*}/../common/unix/mqtt_broker.sh"
2 changes: 1 addition & 1 deletion coin/provisioning/qtci-linux-Ubuntu-16.04-x86_64/30-fbx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
set -ex

BASEDIR=$(dirname "$0")
$BASEDIR/../common/linux/fbx_linux.sh
"$BASEDIR/../common/linux/fbx_linux.sh"
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@

set -ex

# shellcheck source=../common/linux/android_linux.sh
source "${BASH_SOURCE%/*}/../common/linux/android_linux.sh"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

BASEDIR=$(dirname "$0")
$BASEDIR/../common/linux/cmake_linux.sh
"$BASEDIR/../common/linux/cmake_linux.sh"

Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@

set -ex

# shellcheck source=../common/linux/qnx_660.sh
source "${BASH_SOURCE%/*}/../common/linux/qnx_660.sh"
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@

set -ex

# shellcheck source=../common/linux/qnx_700.sh
source "${BASH_SOURCE%/*}/../common/linux/qnx_700.sh"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

BASEDIR=$(dirname "$0")
$BASEDIR/../common/linux/docker.sh
"$BASEDIR/../common/linux/docker.sh"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
BASEDIR=$(dirname "$0")
$BASEDIR/../common/unix/squishInstall.sh
"$BASEDIR/../common/unix/squishInstall.sh"

2 changes: 1 addition & 1 deletion coin/provisioning/qtci-linux-Ubuntu-18.04-x86_64/02-apt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ waitLoop
sudo DEBIAN_FRONTEND=noninteractive apt-get -q -y install "${installPackages[@]}"

# Install all needed packages in a special wheel cache directory
pip3 wheel --wheel-dir $HOME/python3-wheels -r ${BASH_SOURCE%/*}/../common/shared/requirements.txt
pip3 wheel --wheel-dir "$HOME/python3-wheels" -r "${BASH_SOURCE%/*}/../common/shared/requirements.txt"

source "${BASH_SOURCE%/*}/../common/unix/SetEnvVar.sh"
SetEnvVar "PYTHON3_WHEEL_CACHE" "$HOME/python3-wheels"
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

set -ex

# shellcheck source=../common/unix/SetEnvVar.sh
source "${BASH_SOURCE%/*}/../common/unix/SetEnvVar.sh"

# build latest qemu to usermode
Expand Down
4 changes: 3 additions & 1 deletion coin/provisioning/qtci-linux-Ubuntu-18.04-x86_64/04-yocto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@

set -ex

# shellcheck source=../common/unix/DownloadURL.sh
source "${BASH_SOURCE%/*}/../common/unix/DownloadURL.sh"
# shellcheck source=../common/unix/SetEnvVar.sh
source "${BASH_SOURCE%/*}/../common/unix/SetEnvVar.sh"

echo "Installing Yocto toolchain for 32-bit b2qt..."
Expand Down Expand Up @@ -76,7 +78,7 @@ chmod +x "$yoctoInstaller"
/bin/bash "$yoctoInstaller" -y -d "$yoctoLocationARM64"
rm -rf "$yoctoInstaller"

if [ -e "$yoctoLocationARMv7/$sysrootARMv7" -a -e "$yoctoLocationARMv7/${crosscompileARMv7}g++" -a -e "$yoctoLocationARM64/$sysrootARM64" -a -e "$yoctoLocationARM64/${crosscompileARM64}g++" ]; then
if [ -e "$yoctoLocationARMv7/$sysrootARMv7" ] && [ -e "$yoctoLocationARMv7/${crosscompileARMv7}g++" ] && [ -e "$yoctoLocationARM64/$sysrootARM64" ] && [ -e "$yoctoLocationARM64/${crosscompileARM64}g++" ]; then
SetEnvVar "QEMUARMV7_TOOLCHAIN_SYSROOT" "$yoctoLocationARMv7/$sysrootARMv7"
SetEnvVar "QEMUARMV7_TOOLCHAIN_CROSS_COMPILE" "$yoctoLocationARMv7/$crosscompileARMv7"
SetEnvVar "QEMUARM64_TOOLCHAIN_SYSROOT" "$yoctoLocationARM64/$sysrootARM64"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

set -ex

# shellcheck source=../common/unix/DownloadURL.sh
source "${BASH_SOURCE%/*}/../common/unix/DownloadURL.sh"

url="http://ci-files01-hki.intra.qt.io/input/semisecure/test_farm_id_rsa"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@

set -ex

# shellcheck source=../common/linux/openssl_for_android_linux.sh
source "${BASH_SOURCE%/*}/../common/linux/openssl_for_android_linux.sh"
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@
##
#############################################################################

set -ex

# shellcheck source=../common/unix/mqtt_broker.sh
source "${BASH_SOURCE%/*}/../common/unix/mqtt_broker.sh"
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@

set -ex

# shellcheck source=../common/linux/qnx_660.sh
source "${BASH_SOURCE%/*}/../common/linux/qnx_660.sh"
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@

set -ex

# shellcheck source=../common/linux/qnx_700.sh
source "${BASH_SOURCE%/*}/../common/linux/qnx_700.sh"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

BASEDIR=$(dirname "$0")
$BASEDIR/../common/linux/docker.sh
"$BASEDIR/../common/linux/docker.sh"
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash

# shellcheck source=../common/linux/squish-coco.sh
source "${BASH_SOURCE%/*}/../common/linux/squish-coco.sh"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

BASEDIR=$(dirname "$0")
$BASEDIR/../common/linux/ubuntu-version.sh
"$BASEDIR/../common/linux/ubuntu-version.sh"
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ sudo pkcon -y install python-devel python-virtualenv
sudo pkcon -y install libpython3_4m1_0 python3-base python3 python3-pip python3-devel python3-virtualenv python3-wheel

# Install all needed packages in a special wheel cache directory
pip3 wheel --wheel-dir $HOME/python3-wheels -r ${BASH_SOURCE%/*}/../common/shared/requirements.txt
pip3 wheel --wheel-dir "$HOME/python3-wheels" -r "${BASH_SOURCE%/*}/../common/shared/requirements.txt"

# shellcheck source=../common/unix/SetEnvVar.sh
source "${BASH_SOURCE%/*}/../common/unix/SetEnvVar.sh"
SetEnvVar "PYTHON3_WHEEL_CACHE" "$HOME/python3-wheels"
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@

set -ex

# shellcheck source=../common/linux/emsdk.sh
source "${BASH_SOURCE%/*}/../common/linux/emsdk.sh"
4 changes: 3 additions & 1 deletion coin/provisioning/qtci-macos-10.12-x86_64/02-disable-ntp.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash
set -ex

$(dirname $0)/../common/unix/disable-ntp_macos.sh
# shellcheck source=../common/unix/disable-ntp_macos.sh
source "${BASH_SOURCE%/*}/../common/unix/disable-ntp_macos.sh"
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
#!/usr/bin/env bash
$(dirname "$0")/../common/macos/disable_spotlight.sh
set -ex

# shellcheck source=../common/macos/disable_spotlight.sh
source "${BASH_SOURCE%/*}/../common/macos/disable_spotlight.sh"
2 changes: 1 addition & 1 deletion coin/provisioning/qtci-macos-10.12-x86_64/15-xz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

set -ex

# shellcheck source=../common/macos/InstallPKGFromURL
# shellcheck source=../common/macos/InstallPKGFromURL.sh
source "${BASH_SOURCE%/*}/../common/macos/InstallPKGFromURL.sh"

PrimaryUrl="http://ci-files01-hki.intra.qt.io/input/mac/macos_10.12_sierra/XZ.pkg"
Expand Down
4 changes: 3 additions & 1 deletion coin/provisioning/qtci-macos-10.12-x86_64/20-java.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash
set -ex

BASEDIR=$(dirname "$0")
$BASEDIR/../common/macos/java.sh
"$BASEDIR/../common/macos/java.sh"
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

set -ex

# shellcheck source=../common/macos/install-commandlinetools.sh
source "${BASH_SOURCE%/*}/../common/macos/install-commandlinetools.sh"

version="9.2"
Expand Down
2 changes: 1 addition & 1 deletion coin/provisioning/qtci-macos-10.12-x86_64/25-cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
set -ex

BASEDIR=$(dirname "$0")
$BASEDIR/../common/macos/cmake.sh
"$BASEDIR/../common/macos/cmake.sh"
2 changes: 1 addition & 1 deletion coin/provisioning/qtci-macos-10.12-x86_64/25-homebrew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
set -ex

BASEDIR=$(dirname "$0")
$BASEDIR/../common/macos/homebrew.sh
"$BASEDIR/../common/macos/homebrew.sh"
1 change: 1 addition & 0 deletions coin/provisioning/qtci-macos-10.12-x86_64/25-python2.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -ex

# shellcheck source=../common/macos/python2.sh
source "${BASH_SOURCE%/*}/../common/macos/python2.sh"
1 change: 1 addition & 0 deletions coin/provisioning/qtci-macos-10.12-x86_64/25-python3.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -ex

# shellcheck source=../common/macos/python3.sh
source "${BASH_SOURCE%/*}/../common/macos/python3.sh"
2 changes: 1 addition & 1 deletion coin/provisioning/qtci-macos-10.12-x86_64/26-odbc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
set -ex

BASEDIR=$(dirname "$0")
$BASEDIR/../common/macos/libiodbc.sh
"$BASEDIR/../common/macos/libiodbc.sh"
2 changes: 1 addition & 1 deletion coin/provisioning/qtci-macos-10.12-x86_64/26-virtualenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
set -ex

BASEDIR=$(dirname "$0")
$BASEDIR/../common/macos/virtualenv.sh
"$BASEDIR/../common/macos/virtualenv.sh"
2 changes: 1 addition & 1 deletion coin/provisioning/qtci-macos-10.12-x86_64/27-libclang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ set -ex

BASEDIR=$(dirname "$0")
# There is only one mac package
$BASEDIR/../common/unix/libclang.sh
"$BASEDIR/../common/unix/libclang.sh"
2 changes: 1 addition & 1 deletion coin/provisioning/qtci-macos-10.12-x86_64/30-fbx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
set -ex

BASEDIR=$(dirname "$0")
$BASEDIR/../common/macos/fbx_macos.sh
"$BASEDIR/../common/macos/fbx_macos.sh"

1 change: 1 addition & 0 deletions coin/provisioning/qtci-macos-10.12-x86_64/35-openssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

set -ex

# shellcheck source=../common/macos/install_openssl.sh
source "${BASH_SOURCE%/*}/../common/macos/install_openssl.sh"
10 changes: 5 additions & 5 deletions coin/provisioning/qtci-macos-10.12-x86_64/55-signtools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Install "$cache/semisecure/.qt-license" "$targetFolder/.qt-license" $sha1QtLicen
# Login keychain
sha1LoginKeychainPassword="aae58d00d0a1b179a09f21cfc67f9d16fb95ff36"
Install "$cacheSigningTools/login_keychain_password.txt" "$targetFolder/login_keychain_password.txt" "$sha1LoginKeychainPassword"
loginKeychainPassword=$(<"$targetFolder/login_keychain_password.txt")
loginKeychainPassword=$(cat "$targetFolder/login_keychain_password.txt")
loginKeychain=$keychains/login.keychain

echo "Setting login.keychain as default keychain.."
Expand Down Expand Up @@ -104,27 +104,27 @@ open "$keychains/$devIDKeychain"

sha1DeveloperIDTheQtCompanyKeychainPassword="d758e067736bbda7a91ffaec66cd38afdaf68ea6"
Install "$cacheSigningTools/Developer_ID_TheQtCompany_keychain_password.txt" "$targetFolder/Developer_ID_TheQtCompany_keychain_password.txt" "$sha1DeveloperIDTheQtCompanyKeychainPassword"
DeveloperIDTheQtCompanyKeychainPassword=$(<"$targetFolder/Developer_ID_TheQtCompany_keychain_password.txt")
DeveloperIDTheQtCompanyKeychainPassword=$(cat "$targetFolder/Developer_ID_TheQtCompany_keychain_password.txt")

echo "Unlocking $devIDKeychain with password.."
security unlock-keychain -p "$DeveloperIDTheQtCompanyKeychainPassword" $keychains/Developer_ID_TheQtCompany.keychain
security set-keychain-settings $keychains/Developer_ID_TheQtCompany.keychain

sha1Ios="aae58d00d0a1b179a09f21cfc67f9d16fb95ff36"
Install "$cacheSigningTools/ios_password.txt" "$targetFolder/ios_password.txt" $sha1Ios
iosPassword=$(<"$targetFolder/ios_password.txt")
iosPassword=$(cat "$targetFolder/ios_password.txt")

iPhoneDeveloper="iosdevelopment.p12"
shaIPhoneDeveloper="f48f6827e8d0ccdc764cb987e401b9a6f7d3f10c"
Install "$cacheSigningTools/latest_ios_cert/$iPhoneDeveloper" "$targetFolder/$iPhoneDeveloper" $shaIPhoneDeveloper
echo "Importing $iPhoneDeveloper.."
security import $targetFolder/$iPhoneDeveloper -k $loginKeychain* -P $iosPassword -T /usr/bin/codesign
security import $targetFolder/$iPhoneDeveloper -k $loginKeychain* -P "$iosPassword" -T /usr/bin/codesign

iPhoneDistribution="iosdistribution.p12"
shaIPhoneDistribution="64b1174fc3ce0eca044fbc9fa144f6a2d4330171"
Install "$cacheSigningTools/latest_ios_cert/$iPhoneDistribution" "$targetFolder/$iPhoneDistribution" $shaIPhoneDistribution
echo "Importing $iPhoneDistribution.."
security import "$targetFolder/$iPhoneDistribution" -k $loginKeychain* -P $iosPassword -T /usr/bin/codesign
security import "$targetFolder/$iPhoneDistribution" -k $loginKeychain* -P "$iosPassword" -T /usr/bin/codesign

# Mobileprovision
echo "Creating directory $targetFolder/Library/MobileDevice/Provisioning Profiles.."
Expand Down
4 changes: 3 additions & 1 deletion coin/provisioning/qtci-macos-10.12-x86_64/90-squish.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set -ex

BASEDIR=$(dirname "$0")
$BASEDIR/../common/unix/squishInstall.sh
"$BASEDIR/../common/unix/squishInstall.sh"

3 changes: 2 additions & 1 deletion coin/provisioning/qtci-macos-10.13-x86_64/02-disable-ntp.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash

$(dirname $0)/../common/unix/disable-ntp_macos.sh
# shellcheck source=../common/unix/disable-ntp_macos.sh
source "${BASH_SOURCE%/*}/../common/unix/disable-ntp_macos.sh"
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
#!/usr/bin/env bash
$(dirname "$0")/../common/macos/disable_spotlight.sh
set -ex

# shellcheck source=../common/macos/disable_spotlight.sh
source "${BASH_SOURCE%/*}/../common/macos/disable_spotlight.sh"
2 changes: 1 addition & 1 deletion coin/provisioning/qtci-macos-10.13-x86_64/15-xz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

set -ex

# shellcheck source=../common/macos/InstallPKGFromURL
# shellcheck source=../common/macos/InstallPKGFromURL.sh
source "${BASH_SOURCE%/*}/../common/macos/InstallPKGFromURL.sh"

PrimaryUrl="http://ci-files01-hki.intra.qt.io/input/mac/macos_10.12_sierra/XZ.pkg"
Expand Down
4 changes: 3 additions & 1 deletion coin/provisioning/qtci-macos-10.13-x86_64/20-java.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash
set -ex

BASEDIR=$(dirname "$0")
$BASEDIR/../common/macos/java.sh
"$BASEDIR/../common/macos/java.sh"
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

set -ex

# shellcheck source=../common/macos/install-commandlinetools.sh
source "${BASH_SOURCE%/*}/../common/macos/install-commandlinetools.sh"

version="10.1"
Expand Down
2 changes: 1 addition & 1 deletion coin/provisioning/qtci-macos-10.13-x86_64/25-cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
set -ex

BASEDIR=$(dirname "$0")
$BASEDIR/../common/macos/cmake.sh
"$BASEDIR/../common/macos/cmake.sh"
2 changes: 1 addition & 1 deletion coin/provisioning/qtci-macos-10.13-x86_64/25-homebrew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
set -ex

BASEDIR=$(dirname "$0")
$BASEDIR/../common/macos/homebrew.sh
"$BASEDIR/../common/macos/homebrew.sh"
2 changes: 1 addition & 1 deletion coin/provisioning/qtci-macos-10.13-x86_64/25-pip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
set -ex

BASEDIR=$(dirname "$0")
$BASEDIR/../common/macos/pip.sh
"$BASEDIR/../common/macos/pip.sh"
1 change: 1 addition & 0 deletions coin/provisioning/qtci-macos-10.13-x86_64/25-python2.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -ex

# shellcheck source=../common/macos/python2.sh
source "${BASH_SOURCE%/*}/../common/macos/python2.sh"
Loading

0 comments on commit b2afcc8

Please sign in to comment.