ci: add woodpecker pipeline
Add Woodpecker build checks for backend, admin, and site, plus an SSH deploy script for the first non-Docker deployment flow.
This commit is contained in:
parent
f0b50d13ea
commit
823293f01d
2 changed files with 81 additions and 0 deletions
33
deploy/deploy.sh
Executable file
33
deploy/deploy.sh
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
OSAET_ROOT="${OSAET_ROOT:-/opt/osaet}"
|
||||
APP_DIR="${OSAET_APP_DIR:-$OSAET_ROOT/app}"
|
||||
BIN_DIR="${OSAET_BIN_DIR:-$OSAET_ROOT/bin}"
|
||||
SERVICE_NAME="${OSAET_SERVICE_NAME:-osaet-admin}"
|
||||
|
||||
export OSAET_REPO_ROOT="${OSAET_REPO_ROOT:-$APP_DIR}"
|
||||
export OSAET_LOCAL_CONFIG="${OSAET_LOCAL_CONFIG:-$OSAET_ROOT/config/local.yaml}"
|
||||
|
||||
cd "$APP_DIR"
|
||||
git fetch origin main
|
||||
git checkout main
|
||||
git pull --ff-only origin main
|
||||
|
||||
cd "$APP_DIR/frontend/admin"
|
||||
npm ci
|
||||
npm run build
|
||||
|
||||
cd "$APP_DIR/frontend/site"
|
||||
npm ci
|
||||
npm run build
|
||||
|
||||
mkdir -p "$BIN_DIR"
|
||||
cd "$APP_DIR/backend"
|
||||
go test ./...
|
||||
go build -o "$BIN_DIR/osaet-admin" ./cmd/osaet-admin
|
||||
|
||||
"$BIN_DIR/osaet-admin" migrate
|
||||
|
||||
sudo systemctl restart "$SERVICE_NAME"
|
||||
sudo systemctl --no-pager --lines=20 status "$SERVICE_NAME"
|
||||
Loading…
Add table
Add a link
Reference in a new issue