fix(ci): use gbuser@SYSTEM_HOST in deploy ssh/scp commands
This commit is contained in:
parent
b20544d1a0
commit
71b0731461
1 changed files with 5 additions and 4 deletions
|
|
@ -10,6 +10,7 @@ jobs:
|
|||
RUSTC_WRAPPER: ""
|
||||
PATH: /home/gbuser/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||
SYSTEM_HOST: ${{ vars.SYSTEM_HOST }}
|
||||
SYSTEM_USER: gbuser
|
||||
steps:
|
||||
- name: Setup
|
||||
run: |
|
||||
|
|
@ -26,8 +27,8 @@ jobs:
|
|||
- name: Deploy
|
||||
run: |
|
||||
BINARY=/opt/gbo/work/target/debug/botserver
|
||||
ssh -o StrictHostKeyChecking=no $SYSTEM_HOST "sudo systemctl stop botserver 2>/dev/null; sudo pkill -x botserver 2>/dev/null; sleep 1"
|
||||
scp -o StrictHostKeyChecking=no "$BINARY" $SYSTEM_HOST:/opt/gbo/bin/botserver-new
|
||||
ssh -o StrictHostKeyChecking=no $SYSTEM_HOST "sudo mv /opt/gbo/bin/botserver-new /opt/gbo/bin/botserver && sudo chmod +x /opt/gbo/bin/botserver && sudo systemctl enable botserver && sudo systemctl start botserver"
|
||||
ssh -o StrictHostKeyChecking=no ${SYSTEM_USER}@${SYSTEM_HOST} "sudo systemctl stop botserver 2>/dev/null; sudo pkill -x botserver 2>/dev/null; sleep 1"
|
||||
scp -o StrictHostKeyChecking=no "$BINARY" ${SYSTEM_USER}@${SYSTEM_HOST}:/opt/gbo/bin/botserver-new
|
||||
ssh -o StrictHostKeyChecking=no ${SYSTEM_USER}@${SYSTEM_HOST} "sudo mv /opt/gbo/bin/botserver-new /opt/gbo/bin/botserver && sudo chmod +x /opt/gbo/bin/botserver && sudo systemctl enable botserver && sudo systemctl start botserver"
|
||||
sleep 10
|
||||
ssh -o StrictHostKeyChecking=no $SYSTEM_HOST "curl -sf http://localhost:8080/health && echo 'BotServer Deployed' || echo 'Failed'"
|
||||
ssh -o StrictHostKeyChecking=no ${SYSTEM_USER}@${SYSTEM_HOST} "curl -sf http://localhost:8080/health && echo 'BotServer Deployed' || echo 'Failed'"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue