CI: v15 - Dev machine style, just pull no clone
- Remove clone step entirely - Just git pull --rebase in /opt/gbo/data - Build in place like a dev machine - Much faster, no manual clone
This commit is contained in:
parent
80ac912268
commit
1cbc894a76
1 changed files with 13 additions and 23 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
# HASH-BUSTER-20260418-CONTAINER-v14
|
# HASH-BUSTER-20260418-CONTAINER-v15
|
||||||
|
# Dev machine approach: just pull, no clone
|
||||||
# Pre-installed: Rust, Node, Python on runner (ci-alm)
|
# Pre-installed: Rust, Node, Python on runner (ci-alm)
|
||||||
# No installs in YAML - offline first approach
|
|
||||||
name: BotServer CI/CD
|
name: BotServer CI/CD
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
|
@ -18,40 +18,30 @@ jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: gbo
|
runs-on: gbo
|
||||||
steps:
|
steps:
|
||||||
- name: Clone Clean
|
- name: Pull Latest
|
||||||
run: |
|
run: |
|
||||||
echo "=== Clone Clean Workspace ==="
|
echo "=== Pull Latest ==="
|
||||||
rm -rf /opt/gbo/work/build
|
cd /opt/gbo/data
|
||||||
mkdir -p /opt/gbo/work/build
|
git pull --rebase
|
||||||
cd /opt/gbo/work/build
|
cd /opt/gbo/data/botserver
|
||||||
git clone --depth 1 --branch main https://alm.pragmatismo.com.br/GeneralBots/gb.git workspace
|
git pull --rebase
|
||||||
cd workspace
|
cd /opt/gbo/data/botlib
|
||||||
echo "Initializing submodules..."
|
git pull --rebase
|
||||||
git config -f .gitmodules submodule.botserver.url https://alm.pragmatismo.com.br/GeneralBots/BotServer.git
|
|
||||||
git config -f .gitmodules submodule.botlib.url https://alm.pragmatismo.com.br/GeneralBots/botlib.git
|
|
||||||
git submodule update --init --depth 1 botserver
|
|
||||||
git submodule update --init --depth 1 botlib
|
|
||||||
echo "Preparing Cargo.toml..."
|
|
||||||
grep -v '"botapp\|"botdevice\|"bottest\|"botui\|"botbook\|"botmodels\|"botplugin\|"bottemplates"' Cargo.toml > Cargo.toml.clean || true
|
|
||||||
if [ -s Cargo.toml.clean ]; then
|
|
||||||
mv Cargo.toml.clean Cargo.toml
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
echo "=== Build ==="
|
echo "=== Build ==="
|
||||||
cd /opt/gbo/work/build/workspace
|
cd /opt/gbo/data/botserver
|
||||||
cargo build -p botserver
|
cargo build -p botserver
|
||||||
ls -lh target/debug/botserver
|
ls -lh target/debug/botserver
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
run: |
|
run: |
|
||||||
echo "=== Deploy ==="
|
echo "=== Deploy ==="
|
||||||
# Deploy binary to system container
|
BINARY="/opt/gbo/data/botserver/target/debug/botserver"
|
||||||
BINARY="/opt/gbo/work/build/workspace/target/debug/botserver"
|
|
||||||
if [ -f "$BINARY" ]; then
|
if [ -f "$BINARY" ]; then
|
||||||
echo "Binary exists: $BINARY"
|
echo "Binary exists: $BINARY"
|
||||||
# Deploy via SSH to system container
|
# Copy to system container
|
||||||
ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 system@localhost \
|
ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 system@localhost \
|
||||||
"bash -c 'cd /opt/gbo/bin && pkill -f botserver || true; sleep 2'"
|
"bash -c 'cd /opt/gbo/bin && pkill -f botserver || true; sleep 2'"
|
||||||
ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 system@localhost \
|
ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 system@localhost \
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue