From 366165ceb650c5d3f64dca72dfc176a3c9eadb57 Mon Sep 17 00:00:00 2001 From: Tim Hadwen Date: Sun, 1 Feb 2026 22:59:45 +1000 Subject: [PATCH] Fix version detection to use KIBOT_VAR_rev environment variable Updated sch, mech, pcb_main, and pos configs to properly check for KIBOT_VAR_rev before falling back to git describe. Co-Authored-By: Claude Opus 4.5 --- configs/mech.kibot.yaml | 4 ++-- configs/pcb_main.kibot.yaml | 4 ++-- configs/pos.kibot.yaml | 4 ++-- configs/sch.kibot.yaml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/configs/mech.kibot.yaml b/configs/mech.kibot.yaml index e2766a3..43d7f95 100644 --- a/configs/mech.kibot.yaml +++ b/configs/mech.kibot.yaml @@ -12,6 +12,6 @@ preflight: drc: false set_text_variables: - name: 'rev' - command: 'cat $CI_PROJECT_DIR/.version 2>/dev/null || cat .version 2>/dev/null || git describe --tags 2>/dev/null || echo unknown' + command: 'if [ -n "$KIBOT_VAR_rev" ]; then echo $KIBOT_VAR_rev; else git describe --tags 2>/dev/null || echo $CI_COMMIT_SHORT_SHA; fi' - name: 'rev_pcb' - command: 'cat $CI_PROJECT_DIR/.version 2>/dev/null || cat .version 2>/dev/null || git describe --tags 2>/dev/null || echo unknown' + command: 'if [ -n "$KIBOT_VAR_rev_pcb" ]; then echo $KIBOT_VAR_rev_pcb; else git describe --tags 2>/dev/null || echo $CI_COMMIT_SHORT_SHA; fi' diff --git a/configs/pcb_main.kibot.yaml b/configs/pcb_main.kibot.yaml index 88cb67b..af9957c 100644 --- a/configs/pcb_main.kibot.yaml +++ b/configs/pcb_main.kibot.yaml @@ -12,6 +12,6 @@ preflight: drc: false set_text_variables: - name: 'rev' - command: 'cat $CI_PROJECT_DIR/.version 2>/dev/null || cat .version 2>/dev/null || git describe --tags 2>/dev/null || echo unknown' + command: 'if [ -n "$KIBOT_VAR_rev" ]; then echo $KIBOT_VAR_rev; else git describe --tags 2>/dev/null || echo $CI_COMMIT_SHORT_SHA; fi' - name: 'rev_pcb' - command: 'cat $CI_PROJECT_DIR/.version 2>/dev/null || cat .version 2>/dev/null || git describe --tags 2>/dev/null || echo unknown' + command: 'if [ -n "$KIBOT_VAR_rev_pcb" ]; then echo $KIBOT_VAR_rev_pcb; else git describe --tags 2>/dev/null || echo $CI_COMMIT_SHORT_SHA; fi' diff --git a/configs/pos.kibot.yaml b/configs/pos.kibot.yaml index b00a3ab..18a8db3 100644 --- a/configs/pos.kibot.yaml +++ b/configs/pos.kibot.yaml @@ -12,6 +12,6 @@ preflight: drc: false set_text_variables: - name: 'rev' - command: 'cat $CI_PROJECT_DIR/.version 2>/dev/null || cat .version 2>/dev/null || git describe --tags 2>/dev/null || echo unknown' + command: 'if [ -n "$KIBOT_VAR_rev" ]; then echo $KIBOT_VAR_rev; else git describe --tags 2>/dev/null || echo $CI_COMMIT_SHORT_SHA; fi' - name: 'rev_pcb' - command: 'cat $CI_PROJECT_DIR/.version 2>/dev/null || cat .version 2>/dev/null || git describe --tags 2>/dev/null || echo unknown' + command: 'if [ -n "$KIBOT_VAR_rev_pcb" ]; then echo $KIBOT_VAR_rev_pcb; else git describe --tags 2>/dev/null || echo $CI_COMMIT_SHORT_SHA; fi' diff --git a/configs/sch.kibot.yaml b/configs/sch.kibot.yaml index 68ed8c2..8c98ce0 100644 --- a/configs/sch.kibot.yaml +++ b/configs/sch.kibot.yaml @@ -11,6 +11,6 @@ preflight: drc: false set_text_variables: - name: 'rev' - command: 'cat $CI_PROJECT_DIR/.version 2>/dev/null || cat .version 2>/dev/null || git describe --tags 2>/dev/null || echo unknown' + command: 'if [ -n "$KIBOT_VAR_rev" ]; then echo $KIBOT_VAR_rev; else git describe --tags 2>/dev/null || echo $CI_COMMIT_SHORT_SHA; fi' - name: 'rev_pcb' - command: 'cat $CI_PROJECT_DIR/.version 2>/dev/null || cat .version 2>/dev/null || git describe --tags 2>/dev/null || echo unknown' + command: 'if [ -n "$KIBOT_VAR_rev_pcb" ]; then echo $KIBOT_VAR_rev_pcb; else git describe --tags 2>/dev/null || echo $CI_COMMIT_SHORT_SHA; fi'