Files
2025-12-26 13:38:04 +01:00

79 lines
2.0 KiB
YAML

# Pipeline: Testing Branch - Deploy to test.coppertone.tech
when:
- event: push
branch: testing
variables:
- &golang_image "golang:1.25-alpine"
- &node_image "node:22-alpine"
steps:
test-frontend:
image: *node_image
directory: frontend
commands:
- npm ci --prefer-offline
- npm run lint
- npm run type-check
- npm run test:unit -- --run || true
test-backend:
image: *golang_image
commands:
- apk add --no-cache gcc musl-dev
- |
for svc in auth-service blog-service forum-service payment-service work-management-service contact-service ipfs-service; do
if [ -d "backend/functions/$svc" ]; then
echo "=== Testing: $svc ==="
cd backend/functions/$svc
go mod download
go vet ./...
go test -v ./... || true
cd - > /dev/null
fi
done
build-frontend:
image: *node_image
directory: frontend
depends_on:
- test-frontend
commands:
- npm ci --prefer-offline
- npm run build
- echo "Frontend build successful"
deploy-testing:
image: appleboy/drone-ssh
depends_on:
- test-frontend
- test-backend
- build-frontend
settings:
host:
from_secret: deploy_host
username:
from_secret: deploy_user
key:
from_secret: deploy_ssh_key
port: 22
command_timeout: 10m
script:
- echo "=== Deploying to Testing Environment ==="
- cd /docker/web-hosts/domains/test.coppertone.tech/repo
- git fetch origin testing
- git checkout testing
- git pull origin testing
- cd ..
- podman-compose build --no-cache
- podman-compose down --timeout 30
- podman-compose up -d
- sleep 10
- podman-compose ps
- echo "=== Reloading nginx ==="
- /docker/www/scripts/nginx-reload.sh
- echo "=== Deployment complete ==="
# Pipeline test 1763983843
# Test 1763984013
1764091919