Fix: Correct YAML syntax in botserver workflow - Remove blank line in multi-line block (line 27) - Fix indentation for all run commands - Use proper tar extraction syntax for deployment
This commit is contained in:
parent
d453eef57d
commit
8a97c0517f
1 changed files with 22 additions and 22 deletions
|
|
@ -15,26 +15,26 @@ jobs:
|
||||||
SYSTEM_USER: gbuser
|
SYSTEM_USER: gbuser
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Setup
|
- name: Setup
|
||||||
run: |
|
run: |
|
||||||
cd /opt/gbo/work/generalbots
|
cd /opt/gbo/work/generalbots
|
||||||
git reset --hard HEAD
|
git reset --hard HEAD
|
||||||
git clean -fd
|
git clean -fd
|
||||||
git pull
|
git pull
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
mkdir -p /opt/gbo/work/target
|
mkdir -p /opt/gbo/work/target
|
||||||
mkdir -p /opt/gbo/bin
|
mkdir -p /opt/gbo/bin
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
cd /opt/gbo/work/generalbots
|
||||||
|
CARGO_BUILD_JOBS=4 cargo build -p botserver --bin botserver
|
||||||
|
|
||||||
- name: Build
|
- name: Deploy to Stage
|
||||||
run: |
|
run: |
|
||||||
cd /opt/gbo/work/generalbots
|
BINARY=/opt/gbo/work/target/debug/botserver
|
||||||
CARGO_BUILD_JOBS=4 cargo build -p botserver --bin 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"
|
||||||
|
tar -czf /tmp/botserver.tar.gz -C /opt/gbo/work/target/debug botserver
|
||||||
- name: Deploy to Stage
|
ssh -o StrictHostKeyChecking=no ${SYSTEM_USER}@${SYSTEM_HOST} "tar -xzf /tmp/botserver.tar.gz -C /opt/gbo/bin/"
|
||||||
run: |
|
ssh -o StrictHostKeyChecking=no ${SYSTEM_USER}@${SYSTEM_HOST} "sudo chmod +x /opt/gbo/bin/botserver && sudo systemctl enable botserver && sudo systemctl start botserver"
|
||||||
BINARY=/opt/gbo/work/target/debug/botserver
|
sleep 10
|
||||||
ssh -o StrictHostKeyChecking=no ${SYSTEM_USER}@${SYSTEM_HOST} "sudo systemctl stop botserver 2>/dev/null; sudo pkill -x botserver 2>/dev/null; sleep 1"
|
ssh -o StrictHostKeyChecking=no ${SYSTEM_USER}@${SYSTEM_HOST} "curl -sf http://localhost:8080/health && echo 'BotServer Deployed' || echo 'Failed'"
|
||||||
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_USER}@${SYSTEM_HOST} "curl -sf http://localhost:8080/health && echo 'BotServer Deployed' || echo 'Failed'"
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue