CI: v21 - Force clean git state (abort rebase, reset hard)
Some checks failed
BotServer CI/CD / build (push) Has been cancelled
Some checks failed
BotServer CI/CD / build (push) Has been cancelled
This commit is contained in:
parent
1bf8d12f34
commit
82cb2acf4e
1 changed files with 20 additions and 13 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
# HASH-BUSTER-20260418-CONTAINER-v20
|
# HASH-BUSTER-20260418-CONTAINER-v21
|
||||||
# Deploy via Incus file copy instead of SSH
|
# Force clean git state before build
|
||||||
name: BotServer CI/CD
|
name: BotServer CI/CD
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
|
@ -18,18 +18,28 @@ jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: gbo
|
runs-on: gbo
|
||||||
steps:
|
steps:
|
||||||
- name: Pull Latest
|
- name: Force Clean Git State
|
||||||
run: |
|
run: |
|
||||||
echo "=== Pull Latest ==="
|
echo "=== Force Clean Git State ==="
|
||||||
cd /opt/gbo/work/botserver
|
cd /opt/gbo/work/botserver
|
||||||
|
# Abort ANY git operation (rebase, merge, etc)
|
||||||
git rebase --abort 2>/dev/null || true
|
git rebase --abort 2>/dev/null || true
|
||||||
|
git merge --abort 2>/dev/null || true
|
||||||
|
git cherry-pick --abort 2>/dev/null || true
|
||||||
|
# Reset to HEAD
|
||||||
git reset --hard HEAD
|
git reset --hard HEAD
|
||||||
git clean -fd
|
git clean -fd
|
||||||
git pull
|
# Pull fresh
|
||||||
|
git fetch origin main
|
||||||
|
git checkout main
|
||||||
|
git reset --hard origin/main
|
||||||
|
# Remove problematic submodules
|
||||||
rm -rf .github
|
rm -rf .github
|
||||||
grep -v "github" .gitmodules > .gitmodules.tmp || true
|
grep -v "github" .gitmodules > .gitmodules.tmp 2>/dev/null || true
|
||||||
mv .gitmodules.tmp .gitmodules
|
mv .gitmodules.tmp .gitmodules 2>/dev/null || true
|
||||||
|
# Init only required submodules
|
||||||
git submodule update --init --recursive botlib botserver
|
git submodule update --init --recursive botlib botserver
|
||||||
|
echo "Git state: $(git status --short | wc -l) changes"
|
||||||
|
|
||||||
- name: Build BotServer Only
|
- name: Build BotServer Only
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -44,13 +54,10 @@ jobs:
|
||||||
BINARY="/opt/gbo/work/botserver/target/debug/botserver"
|
BINARY="/opt/gbo/work/botserver/target/debug/botserver"
|
||||||
if [ -f "$BINARY" ]; then
|
if [ -f "$BINARY" ]; then
|
||||||
echo "Binary exists: $BINARY"
|
echo "Binary exists: $BINARY"
|
||||||
# Copy binary to system container via incus
|
sudo incus file push "$BINARY" system:/opt/gbo/bin/botserver --mode=0755
|
||||||
sudo incus file push "$BINARY" system/opt/gbo/bin/botserver --mode=0755
|
|
||||||
# Restart botserver service
|
|
||||||
sudo incus exec system -- systemctl restart botserver
|
sudo incus exec system -- systemctl restart botserver
|
||||||
echo "✅ Deploy completed successfully!"
|
echo "✅ Deploy completed!"
|
||||||
echo "Binary timestamp: $(stat -c '%y' /opt/gbo/bin/botserver 2>/dev/null || echo 'N/A')"
|
|
||||||
else
|
else
|
||||||
echo "ERROR: Binary not found at $BINARY"
|
echo "ERROR: Binary not found"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue