CI: v22 - Simplified stages, fast deploy
Some checks failed
BotServer CI / build (push) Has been cancelled
Some checks failed
BotServer CI / build (push) Has been cancelled
This commit is contained in:
parent
82cb2acf4e
commit
1c8cc6626d
1 changed files with 9 additions and 37 deletions
|
|
@ -1,12 +1,9 @@
|
||||||
# HASH-BUSTER-20260418-CONTAINER-v21
|
# v22 - Fast deploy
|
||||||
# Force clean git state before build
|
name: BotServer CI
|
||||||
name: BotServer CI/CD
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
pull_request:
|
|
||||||
branches: [main]
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
SCCACHE_DIR: /opt/gbo/work/.sccache
|
SCCACHE_DIR: /opt/gbo/work/.sccache
|
||||||
|
|
@ -18,46 +15,21 @@ jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: gbo
|
runs-on: gbo
|
||||||
steps:
|
steps:
|
||||||
- name: Force Clean Git State
|
- name: Setup
|
||||||
run: |
|
run: |
|
||||||
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 reset --hard HEAD && git clean -fd
|
||||||
git cherry-pick --abort 2>/dev/null || true
|
git pull && git submodule update --init --recursive botlib botserver
|
||||||
# Reset to HEAD
|
|
||||||
git reset --hard HEAD
|
|
||||||
git clean -fd
|
|
||||||
# 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 2>/dev/null || true
|
|
||||||
mv .gitmodules.tmp .gitmodules 2>/dev/null || true
|
|
||||||
# Init only required submodules
|
|
||||||
git submodule update --init --recursive botlib botserver
|
|
||||||
echo "Git state: $(git status --short | wc -l) changes"
|
|
||||||
|
|
||||||
- name: Build BotServer Only
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
echo "=== Build BotServer ==="
|
|
||||||
cd /opt/gbo/work/botserver
|
cd /opt/gbo/work/botserver
|
||||||
cargo build -p botserver
|
cargo build -p botserver
|
||||||
ls -lh target/debug/botserver
|
ls -lh target/debug/botserver
|
||||||
|
|
||||||
- name: Deploy via Incus
|
- name: Deploy
|
||||||
run: |
|
run: |
|
||||||
echo "=== Deploy ==="
|
B="/opt/gbo/work/botserver/target/debug/botserver"
|
||||||
BINARY="/opt/gbo/work/botserver/target/debug/botserver"
|
[ -f "$B" ] && sudo incus file push "$B" system:/opt/gbo/bin/botserver --mode=0755 && sudo incus exec system -- systemctl restart botserver && echo "✅ Deployed" || echo "❌ Failed"
|
||||||
if [ -f "$BINARY" ]; then
|
|
||||||
echo "Binary exists: $BINARY"
|
|
||||||
sudo incus file push "$BINARY" system:/opt/gbo/bin/botserver --mode=0755
|
|
||||||
sudo incus exec system -- systemctl restart botserver
|
|
||||||
echo "✅ Deploy completed!"
|
|
||||||
else
|
|
||||||
echo "ERROR: Binary not found"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue