fix: Use systemctl for botserver deploy to system container
- Stop botserver via 'sudo systemctl stop' before SCP - Start botserver via 'sudo systemctl start' after copy - Use health check endpoint to verify deployment
This commit is contained in:
parent
6a45629ed3
commit
1b25559a1b
1 changed files with 3 additions and 3 deletions
|
|
@ -26,9 +26,9 @@ jobs:
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
run: |
|
run: |
|
||||||
BINARY=/opt/gbo/work/target/debug/botserver
|
BINARY=/opt/gbo/work/target/debug/botserver
|
||||||
ssh -o StrictHostKeyChecking=no $SYSTEM_HOST "pkill -x botserver || true"
|
ssh -o StrictHostKeyChecking=no $SYSTEM_HOST "sudo systemctl stop botserver"
|
||||||
sleep 2
|
sleep 2
|
||||||
scp -o StrictHostKeyChecking=no "$BINARY" $SYSTEM_HOST:/opt/gbo/bin/botserver
|
scp -o StrictHostKeyChecking=no "$BINARY" $SYSTEM_HOST:/opt/gbo/bin/botserver
|
||||||
ssh -o StrictHostKeyChecking=no $SYSTEM_HOST "cd /opt/gbo/bin && RUST_LOG=info nohup ./botserver --noconsole > /opt/gbo/logs/stdout.log 2> /opt/gbo/logs/stderr.log &"
|
ssh -o StrictHostKeyChecking=no $SYSTEM_HOST "sudo systemctl start botserver"
|
||||||
sleep 10
|
sleep 10
|
||||||
ssh -o StrictHostKeyChecking=no $SYSTEM_HOST "pgrep -x botserver && echo 'BotServer Deployed' || echo 'Failed'"
|
ssh -o StrictHostKeyChecking=no $SYSTEM_HOST "curl -sf http://localhost:8080/health && echo 'BotServer Deployed' || echo 'Failed'"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue