From 2ff68e5a2a24b7b63386efd2e2325d478efbb925 Mon Sep 17 00:00:00 2001 From: "Rodrigo Rodriguez (Pragmatismo)" Date: Sat, 18 Apr 2026 20:48:55 -0300 Subject: [PATCH] CI: v26 - Reset submodules to clean state --- .forgejo/workflows/botserver-v2.yaml | 32 +++++++++++++--------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/.forgejo/workflows/botserver-v2.yaml b/.forgejo/workflows/botserver-v2.yaml index c1b9ab65..858bdec6 100644 --- a/.forgejo/workflows/botserver-v2.yaml +++ b/.forgejo/workflows/botserver-v2.yaml @@ -1,4 +1,4 @@ -# v25 - Deploy: fixed pkill, correct paths +# v26 - Clean submodule state name: BotServer CI on: @@ -19,34 +19,32 @@ jobs: run: | cd /opt/gbo/work/botserver git rebase --abort 2>/dev/null || true - git reset --hard HEAD && git clean -fd - git pull && git submodule update --init --recursive botlib botserver + git reset --hard HEAD + git clean -fd + git pull + # CRITICAL: Reset submodules to clean state + git submodule foreach --recursive git reset --hard HEAD 2>/dev/null || true + git submodule foreach --recursive git clean -fd 2>/dev/null || true + git submodule update --init --recursive botlib botserver + # Verify clean + echo "Submodule status:" + git submodule status | head -5 - name: Build run: | cd /opt/gbo/work/botserver cargo build -p botserver - ls -lh target/debug/botserver - name: Deploy run: | echo "1. Kill old..." timeout 5 bash -c 'while pgrep -x botserver > /dev/null; do pkill -x botserver; sleep 0.5; done' || true - - echo "2. Copy binary..." + echo "2. Copy..." mkdir -p /opt/gbo/bin cp -f /opt/gbo/work/botserver/target/debug/botserver /opt/gbo/bin/ chmod +x /opt/gbo/bin/botserver - - echo "3. Start new..." - cd /opt/gbo/bin - ./botserver --noconsole & + echo "3. Start..." + cd /opt/gbo/bin && ./botserver --noconsole & sleep 3 - echo "4. Verify..." - if pgrep -x botserver > /dev/null 2>&1; then - echo "✅ Running: $(pgrep -x botserver)" - else - echo "❌ Not running" - exit 1 - fi + pgrep -x botserver && echo "✅ Running" || echo "❌ Failed"