From 0277bba20facbf2a2349100170153685da4141b5 Mon Sep 17 00:00:00 2001 From: Tim Hadwen Date: Sun, 24 May 2026 10:25:57 +0000 Subject: [PATCH] =?UTF-8?q?Wrap=20astable=20jobs=20in=20bash=20heredoc=20?= =?UTF-8?q?=E2=80=94=20alpine's=20default=20sh=20is=20ash?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Alpine 3.20 ships busybox ash as /bin/sh, which doesn't parse bash arrays (ARGS=(...) syntax). GitLab CI runs script: blocks with sh -c by default, so we couldn't use the bash array even though we apk-add bash. Wrap the whole block in bash -s <<'EOF' … EOF so bash actually evaluates it. --- kibot-ci.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/kibot-ci.yml b/kibot-ci.yml index ba3cc57..577f916 100644 --- a/kibot-ci.yml +++ b/kibot-ci.yml @@ -366,15 +366,18 @@ astable_dev: artifacts: true - job: generate_3d artifacts: true + # Script body wrapped in `bash -s` because alpine ships busybox ash + # by default, which doesn't parse bash arrays (ARGS=(...)). The + # quoted heredoc keeps GitLab from substituting variables — bash + # sees the raw $CI_PROJECT_DIR etc. and expands them itself. script: - | + bash -s <<'BASH_SCRIPT' + set -euo pipefail FAB="$CI_PROJECT_DIR/Fabrication" SUB="$FAB/${PROJECT_NAME}" VAL="$CI_PROJECT_DIR/Validation" - # Build args list — each --flag is optional; the script skips - # files that aren't present. Dev runs have fewer outputs than - # main (no gerbers/panel), so we just pass what exists. ARGS=( --file "$FAB/${PROJECT_NAME}_dev_bom.csv" --part-ipn "$PROJECT_NAME" @@ -393,6 +396,7 @@ astable_dev: [ -f "$VAL/${PROJECT_NAME}-drc.html" ] && ARGS+=(--drc-report "$VAL/${PROJECT_NAME}-drc.html") upload-bom.sh "${ARGS[@]}" + BASH_SCRIPT astable_main: extends: .astable_base @@ -419,17 +423,15 @@ astable_main: paths: - Fabrication/ expire_in: 1 week + # Same alpine + ash limitation as astable_dev — invoke bash. script: - | + bash -s <<'BASH_SCRIPT' + set -euo pipefail FAB="$CI_PROJECT_DIR/Fabrication" SUB="$FAB/${PROJECT_NAME}" VAL="$CI_PROJECT_DIR/Validation" - # MR-to-main → upload to the dev rev (pre-ordering window). - # Actual main pushes → released rev named from the commit - # message. The BOM CSV's filename always uses ${VERSION} — - # extract_version sets it to "dev" for MRs and the V-token - # for direct pushes, so we can read the same path either way. if [[ "$CI_PIPELINE_SOURCE" == "merge_request_event" ]]; then BRANCH=dev else @@ -457,6 +459,7 @@ astable_main: [ -f "$VAL/${PROJECT_NAME}-drc.html" ] && ARGS+=(--drc-report "$VAL/${PROJECT_NAME}-drc.html") upload-bom.sh "${ARGS[@]}" + BASH_SCRIPT # ============================================================================= # Stage: Release