Skip to content

Commit 5bfc7c7

Browse files
committed
Use bits when appropiate
1 parent 2a4879c commit 5bfc7c7

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

ci/build-loop.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ ensure_vars CI_NAME CHECK_NAME PR_REPO PR_BRANCH PACKAGE ALIBUILD_DEFAULTS PR_ST
2020

2121
host_id=${NOMAD_SHORT_ALLOC_ID:-$(hostname -f)}
2222

23+
# Use bits instead of aliBuild if the check name contains "bits"
24+
if [[ $CHECK_NAME == *bits* ]]; then
25+
BUILD_CMD=bits
26+
else
27+
BUILD_CMD=aliBuild
28+
fi
29+
2330
# Update all PRs in the queue with their number before we start building.
2431
echo "$HASHES" | tail -n "+$((BUILD_SEQ + 1))" | cat -n | while read -r ahead btype num hash envf; do
2532
# Run this in a subshell as report_pr_errors uses $PR_REPO but we don't want
@@ -94,7 +101,7 @@ find separate_logs/ -type f -mtime +5 -delete || true
94101
find separate_logs/ -type d -empty -delete || true
95102

96103
# Run preliminary cleanup command
97-
aliBuild clean --debug
104+
$BUILD_CMD clean --debug
98105

99106
# We are looping over several build hashes here. We will have one log per build.
100107
mkdir -p "separate_logs/$(date -u +%Y%m%d-%H%M%S)-$PR_NUMBER-$PR_HASH"
@@ -202,13 +209,13 @@ if cgroup=$(sed -rn '/:freezer:/{s/.*:freezer:(.*)/\1/p;q}' "/proc/$$/cgroup");
202209
esac
203210
fi
204211

205-
if ! clean_env short_timeout aliDoctor --defaults "$ALIBUILD_DEFAULTS" "$PACKAGE" \
212+
if ! clean_env short_timeout $BUILD_CMD doctor --defaults "$ALIBUILD_DEFAULTS" "$PACKAGE" \
206213
${use_docker:+--architecture "$ARCHITECTURE" --docker-image "$CONTAINER_IMAGE"}
207214
then
208215
# We do not want to kill the system is github is not working
209216
# so we ignore the result code for now
210-
short_timeout set-github-status ${SILENT:+-n} -c "$PR_REPO@$PR_HASH" -s "$CHECK_NAME/error" -m 'aliDoctor error' ||
211-
short_timeout report-analytics exception --desc 'set-github-status fail on aliDoctor error'
217+
short_timeout set-github-status ${SILENT:+-n} -c "$PR_REPO@$PR_HASH" -s "$CHECK_NAME/error" -m "$BUILD_CMD doctor error" ||
218+
short_timeout report-analytics exception --desc "set-github-status fail on $BUILD_CMD doctor error"
212219
# If doctor fails, we can move on to the next PR, since we know it will not work.
213220
# We do not report aliDoctor being ok, because that's really a granted.
214221
exit 1
@@ -244,7 +251,7 @@ build_identifier=${NO_ASSUME_CONSISTENT_EXTERNALS:+${PR_NUMBER//-/_}}
244251
# report-pr-errors looks for errors in it.
245252
# --docker-extra-args=... uses an equals sign as its arg can start with "--",
246253
# --which would confuse argparse if passed as a separate argument.
247-
if clean_env long_timeout aliBuild build "$PACKAGE" \
254+
if clean_env long_timeout $BUILD_CMD build "$PACKAGE" \
248255
-j "${JOBS:-$(nproc)}" -z "$build_identifier" \
249256
--defaults "$ALIBUILD_DEFAULTS" \
250257
${REMOTE_STORE:+--remote-store "$REMOTE_STORE"} \

0 commit comments

Comments
 (0)