fix(ci): Separate deploy steps with timeouts
Some checks failed
BotServer CI/CD / build (push) Failing after 8s
Some checks failed
BotServer CI/CD / build (push) Failing after 8s
This commit is contained in:
parent
1fdb0df634
commit
ab620aa729
1 changed files with 8 additions and 4 deletions
|
|
@ -67,10 +67,12 @@ jobs:
|
|||
echo "=== Deploy started ==="
|
||||
echo "Checking binary exists..."
|
||||
ls -lh /opt/gbo/ci/botserver/target/debug/botserver
|
||||
echo "Killing old botserver..."
|
||||
ssh -o StrictHostKeyChecking=no system "pkill -f botserver || true; sleep 2; rm -f /opt/gbo/bin/botserver && echo 'Old binary removed'"
|
||||
echo "Testing SSH to system..."
|
||||
ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 system "echo SSH OK && pkill -f botserver || true"
|
||||
echo "Removing old binary..."
|
||||
ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 system "rm -f /opt/gbo/bin/botserver && echo 'Old binary removed'"
|
||||
echo "Starting rsync transfer..."
|
||||
rsync -avz --progress -e "ssh -o StrictHostKeyChecking=no -v" /opt/gbo/ci/botserver/target/debug/botserver system:/opt/gbo/bin/botserver 2>&1 | tee /tmp/deploy.log
|
||||
rsync -avz --progress -e "ssh -o StrictHostKeyChecking=no -o ConnectTimeout=30" /opt/gbo/ci/botserver/target/debug/botserver system:/opt/gbo/bin/botserver 2>&1 | tee /tmp/deploy.log
|
||||
RSYNC_EXIT=${PIPESTATUS[0]}
|
||||
echo "rsync exit code: $RSYNC_EXIT"
|
||||
if [ "$RSYNC_EXIT" != "0" ]; then
|
||||
|
|
@ -78,7 +80,9 @@ jobs:
|
|||
exit 1
|
||||
fi
|
||||
echo "rsync SUCCESS, setting permissions..."
|
||||
ssh -o StrictHostKeyChecking=no system "chmod +x /opt/gbo/bin/botserver && chown gbuser:gbuser /opt/gbo/bin/botserver && ls -lh /opt/gbo/bin/botserver && cd /opt/gbo/bin && nohup sudo -u gbuser ./botserver --noconsole >> /opt/gbo/logs/error.log 2>&1 &"
|
||||
ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 system "chmod +x /opt/gbo/bin/botserver && chown gbuser:gbuser /opt/gbo/bin/botserver && ls -lh /opt/gbo/bin/botserver"
|
||||
echo "Starting botserver..."
|
||||
ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 system "cd /opt/gbo/bin && sudo -u gbuser ./botserver --noconsole >> /opt/gbo/logs/error.log 2>&1 &"
|
||||
echo "=== Deploy completed ==="
|
||||
|
||||
- name: Verify botserver started
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue