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:31:27 +03:30
parent 79799b66bb
commit 8eb63d8b3b

View File

@@ -1,113 +1,121 @@
# Peikarband Platform - Woodpecker CI/CD Pipeline # # Peikarband Platform - Woodpecker CI/CD Pipeline
# Complete production-ready pipeline # # 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' # - &python_version '3.11'
# Global configuration # # Global configuration
when:
- evaluate: 'CI_PIPELINE_EVENT != "cron"'
steps:
# ============================================
# 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: # when:
# branch: [main, develop, staging, feature/*, hotfix/*] # - evaluate: 'CI_PIPELINE_EVENT != "cron"'
# lint-yaml: # steps:
# image: cytopia/yamllint:latest # # ============================================
# commands: # # STAGE 1: Code Quality & Linting (DISABLED)
# - yamllint -c .yamllint.yml helm/ || true # # ============================================
# - yamllint woodpecker.yml # # lint-python:
# when: # # image: python:${python_version}-slim
# branch: [main, develop, staging] # # 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:
# STAGE 2 & 3: Tests & Security (DISABLED) # # image: cytopia/yamllint:latest
# ============================================ # # commands:
# test-unit: # # - yamllint -c .yamllint.yml helm/ || true
# image: python:${python_version}-slim # # - yamllint woodpecker.yml
# commands: # # when:
# - pip install --no-cache-dir -r requirements.txt # # branch: [main, develop, staging]
# - pytest tests/unit/
# when:
# branch: [main, develop]
# ============================================ # # ============================================
# STAGE 4: Docker Build & Push (ACTIVE) # # STAGE 2 & 3: Tests & Security (DISABLED)
# ============================================ # # ============================================
docker-build: # # test-unit:
image: plugins/docker # # image: python:${python_version}-slim
settings: # # commands:
registry: *harbor_registry # # - pip install --no-cache-dir -r requirements.txt
repo: ${harbor_registry}/${image_name} # # - pytest tests/unit/
tags: # # when:
- ${CI_COMMIT_SHA:0:8} # # branch: [main, develop]
- ${CI_COMMIT_BRANCH}
- latest
username:
from_secret: harbor_username
password:
from_secret: harbor_password
build_args:
- ENVIRONMENT=production
- VERSION=${CI_COMMIT_SHA:0:8}
cache_from:
- ${harbor_registry}/${image_name}:latest
dockerfile: Dockerfile
dry_run: false
when:
event: [push, tag, manual]
# ============================================ # # ============================================
# STAGE 5 - 11: Deployment & Notifications (DISABLED) # # STAGE 4: Docker Build & Push (ACTIVE)
# ============================================ # # ============================================
# deploy-staging: # docker-build:
# image: argoproj/argocd:latest # image: plugins/docker
# environment:
# ARGOCD_SERVER: { from_secret: argocd_server }
# ARGOCD_AUTH_TOKEN: { from_secret: argocd_token }
# commands:
# - argocd app set peikarband-staging --helm-set image.tag=${CI_COMMIT_SHA:0:8}
# - argocd app sync peikarband-staging
# when:
# branch: [develop, staging]
# notify-telegram:
# image: appleboy/drone-telegram:latest
# settings: # settings:
# token: { from_secret: telegram_bot_token } # registry: *harbor_registry
# to: { from_secret: telegram_chat_id } # repo: ${harbor_registry}/${image_name}
# tags:
# - ${CI_COMMIT_SHA:0:8}
# - ${CI_COMMIT_BRANCH}
# - latest
# username:
# from_secret: harbor_username
# password:
# from_secret: harbor_password
# build_args:
# - ENVIRONMENT=production
# - VERSION=${CI_COMMIT_SHA:0:8}
# cache_from:
# - ${harbor_registry}/${image_name}:latest
# dockerfile: Dockerfile
# dry_run: false
# when: # when:
# status: [success, failure] # event: [push, tag, manual]
# ============================================ # # ============================================
# Services & Workspace Configuration # # STAGE 5 - 11: Deployment & Notifications (DISABLED)
# ============================================ # # ============================================
# (سرویس‌ها فعلاً کامنت شدند چون تستی اجرا نمی‌شود) # # deploy-staging:
# services: # # image: argoproj/argocd:latest
# postgres: # # environment:
# image: postgres:14-alpine # # ARGOCD_SERVER: { from_secret: argocd_server }
# # ARGOCD_AUTH_TOKEN: { from_secret: argocd_token }
# # commands:
# # - argocd app set peikarband-staging --helm-set image.tag=${CI_COMMIT_SHA:0:8}
# # - argocd app sync peikarband-staging
# # when:
# # branch: [develop, staging]
workspace: # # notify-telegram:
base: /woodpecker/src # # image: appleboy/drone-telegram:latest
path: workspace # # settings:
# # token: { from_secret: telegram_bot_token }
# # to: { from_secret: telegram_chat_id }
# # when:
# # status: [success, failure]
clone: # # ============================================
git: # # Services & Workspace Configuration
image: woodpeckerci/plugin-git:latest # # ============================================
settings: # # (سرویس‌ها فعلاً کامنت شدند چون تستی اجرا نمی‌شود)
depth: 50 # # services:
tags: true # # postgres:
# # image: postgres:14-alpine
# workspace:
# base: /woodpecker/src
# path: workspace
# clone:
# git:
# image: woodpeckerci/plugin-git:latest
# settings:
# depth: 50
# tags: true
# فایل تست بسیار ساده - تمام بخش‌های قبلی را پاک کن و فقط این را بگذار
steps:
test-build:
image: alpine
commands:
- echo "Testing Woodpecker Connection..."
- date