added files
Some checks failed
CD - Build & Deploy / build-and-push (push) Has been cancelled
CD - Build & Deploy / package-helm (push) Has been cancelled
CD - Build & Deploy / deploy-staging (push) Has been cancelled
CD - Build & Deploy / deploy-production (push) Has been cancelled
CD - Build & Deploy / release (push) Has been cancelled
CI / test (3.11) (push) Has been cancelled
CI / test (3.12) (push) Has been cancelled
CI / security (push) Has been cancelled

This commit is contained in:
Ehsan.Asadi
2025-12-27 23:26:12 +03:30
parent 4f224a88cd
commit 79799b66bb

View File

@@ -1,26 +1,61 @@
# Peikarband Platform - Woodpecker CI/CD Pipeline # Peikarband Platform - Woodpecker CI/CD Pipeline
# وضعیت: فقط بیلد و پوش به Harbor فعال است # Complete production-ready pipeline
variables: variables:
- &harbor_registry 'harbor.peikarband.ir' - &harbor_registry 'harbor.peikarband.ir'
- &image_name 'peikarband/landing' - &image_name 'peikarband/landing'
- &python_version '3.11'
# تنظیمات کلی برای اجرا در هر پوش # Global configuration
when: when:
- evaluate: 'CI_PIPELINE_EVENT != "cron"' - evaluate: 'CI_PIPELINE_EVENT != "cron"'
steps: steps:
# ============================================ # ============================================
# STAGE: Docker Build & Push (تنها بخش فعال) # STAGE 1: Code Quality & Linting (DISABLED)
# ============================================
# lint-python:
# image: python:${python_version}-slim
# environment:
# - PYTHONPATH=/woodpecker/src/workspace
# commands:
# - pip install --no-cache-dir flake8 black isort mypy
# - flake8 src/ --max-line-length=120 --exclude=__pycache__,migrations --statistics
# - black --check src/ --line-length=120
# - isort --check-only src/
# when:
# branch: [main, develop, staging, feature/*, hotfix/*]
# lint-yaml:
# image: cytopia/yamllint:latest
# commands:
# - yamllint -c .yamllint.yml helm/ || true
# - yamllint woodpecker.yml
# when:
# branch: [main, develop, staging]
# ============================================
# STAGE 2 & 3: Tests & Security (DISABLED)
# ============================================
# test-unit:
# image: python:${python_version}-slim
# commands:
# - pip install --no-cache-dir -r requirements.txt
# - pytest tests/unit/
# when:
# branch: [main, develop]
# ============================================
# STAGE 4: Docker Build & Push (ACTIVE)
# ============================================ # ============================================
docker-build: docker-build:
image: plugins/docker image: plugins/docker
settings: settings:
registry: *harbor_registry registry: *harbor_registry
repo: ${harbor_registry}/${image_name} repo: ${harbor_registry}/${image_name}
# تگ کردن تصویر با هش کامیت و کلمه latest
tags: tags:
- ${CI_COMMIT_SHA:0:8} - ${CI_COMMIT_SHA:0:8}
- ${CI_COMMIT_BRANCH}
- latest - latest
username: username:
from_secret: harbor_username from_secret: harbor_username
@@ -28,23 +63,17 @@ steps:
from_secret: harbor_password from_secret: harbor_password
build_args: build_args:
- ENVIRONMENT=production - ENVIRONMENT=production
# استفاده از کش برای سرعت بیشتر در بیلدهای بعدی - VERSION=${CI_COMMIT_SHA:0:8}
cache_from: ${harbor_registry}/${image_name}:latest cache_from:
- ${harbor_registry}/${image_name}:latest
dockerfile: Dockerfile
dry_run: false
when: when:
event: [push, tag] event: [push, tag, manual]
# ============================================ # ============================================
# بخش‌های غیرفعال (کامنت شده) # STAGE 5 - 11: Deployment & Notifications (DISABLED)
# ============================================ # ============================================
# lint-python:
# image: python:3.11-slim
# commands:
# - pip install --no-cache-dir flake8 black
# - flake8 src/
# when:
# branch: [main, develop]
# deploy-staging: # deploy-staging:
# image: argoproj/argocd:latest # image: argoproj/argocd:latest
# environment: # environment:
@@ -54,7 +83,7 @@ steps:
# - argocd app set peikarband-staging --helm-set image.tag=${CI_COMMIT_SHA:0:8} # - argocd app set peikarband-staging --helm-set image.tag=${CI_COMMIT_SHA:0:8}
# - argocd app sync peikarband-staging # - argocd app sync peikarband-staging
# when: # when:
# branch: [develop] # branch: [develop, staging]
# notify-telegram: # notify-telegram:
# image: appleboy/drone-telegram:latest # image: appleboy/drone-telegram:latest
@@ -62,4 +91,23 @@ steps:
# token: { from_secret: telegram_bot_token } # token: { from_secret: telegram_bot_token }
# to: { from_secret: telegram_chat_id } # to: { from_secret: telegram_chat_id }
# when: # when:
# status: [success, failure] # status: [success, failure]
# ============================================
# Services & Workspace Configuration
# ============================================
# (سرویس‌ها فعلاً کامنت شدند چون تستی اجرا نمی‌شود)
# services:
# postgres:
# image: postgres:14-alpine
workspace:
base: /woodpecker/src
path: workspace
clone:
git:
image: woodpeckerci/plugin-git:latest
settings:
depth: 50
tags: true