From 4cc1e3aa4b528cb1bf6aea130c7eaed5c14bf8a8 Mon Sep 17 00:00:00 2001 From: "Rodrigo Rodriguez (Pragmatismo)" Date: Fri, 10 Apr 2026 21:15:16 -0300 Subject: [PATCH] Fix CI: Clean up all workspaces on system before build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - SSH to system container and clean unused workspaces - Keep only botserver/target and active CI directories - Clean alm-ci workspaces not used by botserver - Free up disk space before compilation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .forgejo/workflows/botserver.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.forgejo/workflows/botserver.yaml b/.forgejo/workflows/botserver.yaml index 1fa42aed..33d8ff2e 100644 --- a/.forgejo/workflows/botserver.yaml +++ b/.forgejo/workflows/botserver.yaml @@ -65,6 +65,23 @@ jobs: echo "All system dependencies already installed" fi + - name: Clean up all workspaces + run: | + set -e + SSH_ARGS="-i /home/gbuser/.ssh/id_ed25519 -o StrictHostKeyChecking=no -o ConnectTimeout=5 -o ServerAliveInterval=5 -o ServerAliveCountMax=2 -o BatchMode=yes" + echo "=== Cleaning up all workspaces on system container ===" + # Clean /opt/gbo/data/botserver workspace (keep only target) + ssh $SSH_ARGS system "find /opt/gbo/data/botserver -maxdepth 1 ! -path '*/target' ! -path '*/.git' -print0 2>/dev/null | xargs -0 rm -rf || true" + # Clean /opt/gbo/data/botserver/target (keep only current build) + ssh $SSH_ARGS system "find /opt/gbo/data/botserver/target -name '*.rlib' -type f -printf '%T@%p\n' 2>/dev/null | sort -r | tail -n +4 | while read t f; do [ -n \"\$f\" ] && rm -f \"\$f\"; done" + # Clean alm-ci workspaces (keep only what CI uses) + ssh $SSH_ARGS system "find /opt/gbo/data -maxdepth 2 ! -path '*/botserver' ! -path '*/gb-ws' -print0 2>/dev/null | xargs -0 rm -rf || true" + # Clean old log files + ssh $SSH_ARGS system "find /tmp -name '*.log' -type f -mtime +7 -print0 2>/dev/null | xargs -0 rm -f || true" + # Show disk space + ssh $SSH_ARGS system "df -h /opt/gbo/data" + echo "=== Workspace cleanup complete ===" + - name: Build BotServer working-directory: /opt/gbo/data/botserver run: |