fix(ci): Add verbose traces to rsync deploy step
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
1e14bd8b3b
commit
1fdb0df634
1 changed files with 16 additions and 3 deletions
|
|
@ -64,9 +64,22 @@ jobs:
|
|||
|
||||
- name: Deploy via rsync
|
||||
run: |
|
||||
ssh -o StrictHostKeyChecking=no system "pkill -f botserver || true; sleep 2; rm -f /opt/gbo/bin/botserver"
|
||||
rsync -avz -e "ssh -o StrictHostKeyChecking=no" /opt/gbo/ci/botserver/target/debug/botserver system:/opt/gbo/bin/botserver 2>&1 | tee /tmp/deploy.log
|
||||
ssh -o StrictHostKeyChecking=no system "chmod +x /opt/gbo/bin/botserver && chown gbuser:gbuser /opt/gbo/bin/botserver && cd /opt/gbo/bin && nohup sudo -u gbuser ./botserver --noconsole >> /opt/gbo/logs/error.log 2>&1 &"
|
||||
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 "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_EXIT=${PIPESTATUS[0]}
|
||||
echo "rsync exit code: $RSYNC_EXIT"
|
||||
if [ "$RSYNC_EXIT" != "0" ]; then
|
||||
echo "rsync FAILED with exit code $RSYNC_EXIT"
|
||||
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 &"
|
||||
echo "=== Deploy completed ==="
|
||||
|
||||
- name: Verify botserver started
|
||||
run: |
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue