diff --git a/.woodpecker/build.yml b/.woodpecker/build.yml deleted file mode 100644 index 7907243..0000000 --- a/.woodpecker/build.yml +++ /dev/null @@ -1,43 +0,0 @@ -# Woodpecker CI - Build Pipeline (runs on main branch pushes) - -steps: - build-images: - image: docker:24-dind - commands: - - echo "=== Building Docker images ===" - - docker build -t sysmonstm/aggregator:${CI_COMMIT_SHA:0:7} -f services/aggregator/Dockerfile --target production . - - docker build -t sysmonstm/gateway:${CI_COMMIT_SHA:0:7} -f services/gateway/Dockerfile --target production . - - docker build -t sysmonstm/collector:${CI_COMMIT_SHA:0:7} -f services/collector/Dockerfile --target production . - - docker build -t sysmonstm/alerts:${CI_COMMIT_SHA:0:7} -f services/alerts/Dockerfile --target production . - - echo "=== Tagging as latest ===" - - docker tag sysmonstm/aggregator:${CI_COMMIT_SHA:0:7} sysmonstm/aggregator:latest - - docker tag sysmonstm/gateway:${CI_COMMIT_SHA:0:7} sysmonstm/gateway:latest - - docker tag sysmonstm/collector:${CI_COMMIT_SHA:0:7} sysmonstm/collector:latest - - docker tag sysmonstm/alerts:${CI_COMMIT_SHA:0:7} sysmonstm/alerts:latest - volumes: - - /var/run/docker.sock:/var/run/docker.sock - - push-to-registry: - image: docker:24-dind - commands: - - echo "=== Logging into registry ===" - - echo "$REGISTRY_PASSWORD" | docker login -u "$REGISTRY_USER" --password-stdin "$REGISTRY_URL" - - echo "=== Pushing images ===" - - | - for svc in aggregator gateway collector alerts; do - docker tag sysmonstm/$svc:${CI_COMMIT_SHA:0:7} $REGISTRY_URL/sysmonstm/$svc:${CI_COMMIT_SHA:0:7} - docker tag sysmonstm/$svc:latest $REGISTRY_URL/sysmonstm/$svc:latest - docker push $REGISTRY_URL/sysmonstm/$svc:${CI_COMMIT_SHA:0:7} - docker push $REGISTRY_URL/sysmonstm/$svc:latest - echo "Pushed $svc" - done - secrets: [registry_user, registry_password, registry_url] - volumes: - - /var/run/docker.sock:/var/run/docker.sock - -depends_on: - - test - -when: - event: push - branch: main diff --git a/.woodpecker/deploy.yml b/.woodpecker/deploy.yml deleted file mode 100644 index 3cd7a44..0000000 --- a/.woodpecker/deploy.yml +++ /dev/null @@ -1,61 +0,0 @@ -# Woodpecker CI - Deploy Pipeline - -steps: - deploy-to-staging: - image: appleboy/drone-ssh - settings: - host: - from_secret: deploy_host - username: - from_secret: deploy_user - key: - from_secret: deploy_key - port: 22 - script: - - echo "=== Deploying to staging ===" - - cd /home/ec2-user/sysmonstm - - git fetch origin main - - git reset --hard origin/main - - echo "=== Pulling new images ===" - - docker-compose pull - - echo "=== Restarting services ===" - - docker-compose up -d --remove-orphans - - echo "=== Cleaning up ===" - - docker system prune -f - - echo "=== Deployment complete ===" - - docker-compose ps - - health-check: - image: curlimages/curl - commands: - - echo "=== Waiting for services to start ===" - - sleep 10 - - echo "=== Checking gateway health ===" - - curl -f http://$DEPLOY_HOST:8000/health || exit 1 - - echo "=== Health check passed ===" - secrets: [deploy_host] - - notify: - image: plugins/webhook - settings: - urls: - from_secret: webhook_url - content_type: application/json - template: | - { - "text": "🚀 Deployed to staging", - "repo": "${CI_REPO_NAME}", - "commit": "${CI_COMMIT_SHA:0:7}", - "message": "${CI_COMMIT_MESSAGE}", - "author": "${CI_COMMIT_AUTHOR}", - "url": "https://sysmonstm.mcrn.ar" - } - when: - status: success - -depends_on: - - build - -when: - event: push - branch: main diff --git a/.woodpecker/test.yml b/.woodpecker/test.yml deleted file mode 100644 index 3d19ad6..0000000 --- a/.woodpecker/test.yml +++ /dev/null @@ -1,37 +0,0 @@ -# Woodpecker CI - Test Pipeline (runs on PRs and pushes) - -steps: - - name: lint - image: python:3.11-slim - commands: - - pip install --quiet ruff mypy - - echo "=== Linting with ruff ===" - - ruff check services/ shared/ --output-format=github - - echo "=== Checking formatting ===" - - ruff format --check services/ shared/ - - - name: typecheck - image: python:3.11-slim - commands: - - pip install --quiet mypy types-redis - - echo "=== Type checking shared/ ===" - - mypy shared/ --ignore-missing-imports || true - - - name: unit-tests - image: python:3.11-slim - commands: - - pip install --quiet pytest pytest-asyncio pytest-cov - - pip install --quiet redis asyncpg grpcio grpcio-tools psutil pydantic pydantic-settings structlog - - echo "=== Running unit tests ===" - - pytest shared/ services/ -v --tb=short --cov=shared --cov=services --cov-report=term-missing || true - - - name: proto-check - image: python:3.11-slim - commands: - - pip install --quiet grpcio-tools - - echo "=== Validating proto definitions ===" - - python -m grpc_tools.protoc -I./proto --python_out=/tmp --grpc_python_out=/tmp ./proto/metrics.proto - - echo "Proto compilation successful" - -when: - - event: [push, pull_request]