Add script to run all (provisioning) shell scripts in given directory

To build / test Qt on a fresh VM, all provisioning scripts have to be
run.

Provide a shell script to facilitate this on Linux and macOS.

Fixes: QTQAINFRA-7906
Pick-to: 6.8
Change-Id: Ie06c11c824897d23c74d90c008a595c2f82f6950
Reviewed-by: Simo Fält <simo.falt@qt.io>
(cherry picked from commit c0e391423d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 707c9b73d1)
This commit is contained in:
Axel Spoerl
2026-05-21 15:38:41 +02:00
committed by Qt Cherry-pick Bot
parent 635b735839
commit 8582435db6

View File

@@ -0,0 +1,32 @@
#!/bin/sh
# Copyright (C) 2026 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#
# Usage: ./qt_run_all.sh [directory]
# Script to run all provisioning scripts in the current directory in alphabetical order
# for the purpose of manually provisioning a freshly installed Linux / macOS system
#
# Caution:
# - Don't copy this to or call it from a platform provisioning directory
# - It's not guaranteed that scripts are run in the exact same order as during COIN provisioning
#
set -e
DIR="${1:-.}"
DIR="$(cd "$DIR" 2>/dev/null && pwd)" || {
echo "Error: directory not found or not accessible." >&2
exit 1
}
echo "Running .sh files in: $DIR"
find "$DIR" -maxdepth 1 -name "*.sh" | sort | while IFS= read -r script; do
# Skip ourselves
[ "$(realpath "$script")" = "$(realpath "$0")" ] && continue
echo "--- Running: $script"
sh "$script"
echo "------ Done: $script (exit code: $?)"
done
echo "Provisioning done."