2020-04-21 17:03:17 +00:00
|
|
|
#!/usr/bin/env bash
|
2018-11-12 09:05:35 +00:00
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
unset CDPATH
|
|
|
|
|
cd "$(dirname "${BASH_SOURCE[0]}")/.." # cd to repo root dir
|
|
|
|
|
|
2019-12-07 00:32:23 +00:00
|
|
|
parallel_run() {
|
2020-04-15 19:44:36 +00:00
|
|
|
./dev/ci/parallel_run.sh "$@"
|
2019-12-07 00:32:23 +00:00
|
|
|
}
|
|
|
|
|
|
2020-04-21 17:03:17 +00:00
|
|
|
export ARGS=$*
|
2019-12-07 00:32:23 +00:00
|
|
|
|
2022-08-25 09:48:58 +00:00
|
|
|
# Keep the list of client workspaces in alphabetical order!
|
2019-12-07 00:32:23 +00:00
|
|
|
DIRS=(
|
2020-10-08 13:14:34 +00:00
|
|
|
client/branded
|
2020-10-07 20:23:53 +00:00
|
|
|
client/browser
|
2021-10-12 16:14:50 +00:00
|
|
|
client/build-config
|
2022-08-25 09:48:58 +00:00
|
|
|
client/client-api
|
2022-01-10 15:29:47 +00:00
|
|
|
client/codeintellify
|
2024-04-09 19:29:35 +00:00
|
|
|
client/common
|
2021-03-26 07:35:26 +00:00
|
|
|
client/extension-api
|
|
|
|
|
client/extension-api-types
|
2022-08-25 09:48:58 +00:00
|
|
|
client/http-client
|
2022-05-24 08:32:03 +00:00
|
|
|
client/jetbrains
|
2022-08-17 08:57:00 +00:00
|
|
|
client/observability-client
|
2022-08-16 09:15:58 +00:00
|
|
|
client/observability-server
|
2022-08-25 09:48:58 +00:00
|
|
|
client/shared
|
|
|
|
|
client/storybook
|
|
|
|
|
client/template-parser
|
2022-12-23 02:04:50 +00:00
|
|
|
client/testing
|
2022-08-25 09:48:58 +00:00
|
|
|
client/vscode
|
|
|
|
|
client/wildcard
|
2019-12-07 00:32:23 +00:00
|
|
|
)
|
2022-08-25 09:48:58 +00:00
|
|
|
# Keep the list of client workspaces in alphabetical order!
|
2019-12-07 00:32:23 +00:00
|
|
|
|
|
|
|
|
run_command() {
|
2020-04-15 19:44:36 +00:00
|
|
|
local MAYBE_TIME_PREFIX=""
|
|
|
|
|
if [[ "${CI_DEBUG_PROFILE:-"false"}" == "true" ]]; then
|
|
|
|
|
MAYBE_TIME_PREFIX="env time -v"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
dir=$1
|
|
|
|
|
echo "--- $dir: $ARGS"
|
|
|
|
|
(
|
|
|
|
|
set -x
|
|
|
|
|
cd "$dir" && eval "${MAYBE_TIME_PREFIX} ${ARGS}"
|
|
|
|
|
)
|
2021-03-26 16:19:26 +00:00
|
|
|
ecode="$?"
|
2021-03-10 12:06:47 +00:00
|
|
|
|
|
|
|
|
# shellcheck disable=SC2181
|
|
|
|
|
# We are checking the sub-shell, following SC2181 would make this unreadable
|
2021-03-26 16:19:26 +00:00
|
|
|
if [[ $ecode -ne 0 ]]; then
|
2021-03-10 12:06:47 +00:00
|
|
|
echo "^^^ +++"
|
2021-03-26 16:19:26 +00:00
|
|
|
exit $ecode
|
2021-03-10 12:06:47 +00:00
|
|
|
fi
|
2019-12-07 00:32:23 +00:00
|
|
|
}
|
|
|
|
|
export -f run_command
|
|
|
|
|
|
|
|
|
|
if [[ "${CI:-"false"}" == "true" ]]; then
|
2020-04-15 19:44:36 +00:00
|
|
|
echo "--- 🚨 Buildkite's timing information is misleading! Only consider the job timing that's printed after 'done'"
|
2019-12-07 00:32:23 +00:00
|
|
|
|
2020-04-15 19:44:36 +00:00
|
|
|
parallel_run run_command {} ::: "${DIRS[@]}"
|
2019-12-07 00:32:23 +00:00
|
|
|
else
|
2020-04-15 19:44:36 +00:00
|
|
|
for dir in "${DIRS[@]}"; do
|
2020-04-21 17:03:17 +00:00
|
|
|
run_command "$dir"
|
2020-04-15 19:44:36 +00:00
|
|
|
done
|
2019-12-07 00:32:23 +00:00
|
|
|
fi
|