CI: v24 - Deploy with traces and verification
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
46e5d16892
commit
6f003a313c
1 changed files with 23 additions and 5 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
# v23 - Simple deploy: stop, copy, start
|
# v24 - Deploy with traces
|
||||||
name: BotServer CI
|
name: BotServer CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
|
@ -29,9 +29,27 @@ jobs:
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
run: |
|
run: |
|
||||||
|
echo "Deploy step 1/4: Stopping..."
|
||||||
sudo pkill -f botserver || true
|
sudo pkill -f botserver || true
|
||||||
sleep 1
|
sleep 1
|
||||||
cp /opt/gbo/work/botserver/target/debug/botserver /opt/gbo/bin/botserver
|
|
||||||
cd /opt/gbo/bin && RUST_LOG=info nohup ./botserver --noconsole > /opt/gbo/logs/stdout.log 2>&1 &
|
echo "Deploy step 2/4: Copying..."
|
||||||
sleep 2
|
cp -f /opt/gbo/work/botserver/target/debug/botserver /opt/gbo/bin/botserver
|
||||||
pgrep -f botserver && echo "✅ Running" || echo "❌ Failed"
|
chmod +x /opt/gbo/bin/botserver
|
||||||
|
|
||||||
|
echo "Deploy step 3/4: Starting..."
|
||||||
|
cd /opt/gbo/bin
|
||||||
|
nohup ./botserver --noconsole > /opt/gbo/logs/stdout.log 2>&1 &
|
||||||
|
BOT_PID=$!
|
||||||
|
echo "Started PID: $BOT_PID"
|
||||||
|
|
||||||
|
echo "Deploy step 4/4: Verifying..."
|
||||||
|
sleep 3
|
||||||
|
if pgrep -f botserver > /dev/null; then
|
||||||
|
echo "✅ Success - botserver running"
|
||||||
|
pgrep -f botserver
|
||||||
|
else
|
||||||
|
echo "❌ Failed - botserver not running"
|
||||||
|
cat /opt/gbo/logs/stdout.log | tail -10
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue