CI: v26 - Reset submodules to clean state
Some checks failed
BotServer CI / build (push) Failing after 4s
Some checks failed
BotServer CI / build (push) Failing after 4s
This commit is contained in:
parent
c218556a94
commit
2ff68e5a2a
1 changed files with 15 additions and 17 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
# v25 - Deploy: fixed pkill, correct paths
|
# v26 - Clean submodule state
|
||||||
name: BotServer CI
|
name: BotServer CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
|
@ -19,34 +19,32 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
cd /opt/gbo/work/botserver
|
cd /opt/gbo/work/botserver
|
||||||
git rebase --abort 2>/dev/null || true
|
git rebase --abort 2>/dev/null || true
|
||||||
git reset --hard HEAD && git clean -fd
|
git reset --hard HEAD
|
||||||
git pull && git submodule update --init --recursive botlib botserver
|
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
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
cd /opt/gbo/work/botserver
|
cd /opt/gbo/work/botserver
|
||||||
cargo build -p botserver
|
cargo build -p botserver
|
||||||
ls -lh target/debug/botserver
|
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
run: |
|
run: |
|
||||||
echo "1. Kill old..."
|
echo "1. Kill old..."
|
||||||
timeout 5 bash -c 'while pgrep -x botserver > /dev/null; do pkill -x botserver; sleep 0.5; done' || true
|
timeout 5 bash -c 'while pgrep -x botserver > /dev/null; do pkill -x botserver; sleep 0.5; done' || true
|
||||||
|
echo "2. Copy..."
|
||||||
echo "2. Copy binary..."
|
|
||||||
mkdir -p /opt/gbo/bin
|
mkdir -p /opt/gbo/bin
|
||||||
cp -f /opt/gbo/work/botserver/target/debug/botserver /opt/gbo/bin/
|
cp -f /opt/gbo/work/botserver/target/debug/botserver /opt/gbo/bin/
|
||||||
chmod +x /opt/gbo/bin/botserver
|
chmod +x /opt/gbo/bin/botserver
|
||||||
|
echo "3. Start..."
|
||||||
echo "3. Start new..."
|
cd /opt/gbo/bin && ./botserver --noconsole &
|
||||||
cd /opt/gbo/bin
|
|
||||||
./botserver --noconsole &
|
|
||||||
sleep 3
|
sleep 3
|
||||||
|
|
||||||
echo "4. Verify..."
|
echo "4. Verify..."
|
||||||
if pgrep -x botserver > /dev/null 2>&1; then
|
pgrep -x botserver && echo "✅ Running" || echo "❌ Failed"
|
||||||
echo "✅ Running: $(pgrep -x botserver)"
|
|
||||||
else
|
|
||||||
echo "❌ Not running"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue