diff --git a/.woodpecker.yml b/.woodpecker.yml index c45a10b..0687615 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,25 +1,26 @@ # Peikarband Platform - Woodpecker CI/CD Pipeline -variables: - - &harbor_registry "hub.peikarband.ir" - - &image_name "peikarband/landing" +# Harbor registry: hub.peikarband.ir (مطابق با values-prd.yaml) steps: + # مرحله ساخت با Kaniko Executor (مستقیم - مطمئن‌تر از plugin) build-and-push: - image: plugins/kaniko - settings: - registry: *harbor_registry - repo: *image_name - tags: - - latest - - ${CI_COMMIT_SHA:0:8} - username: - from_secret: harbor_username - password: - from_secret: harbor_password - dockerfile: Dockerfile - context: . - insecure: false - skip_tls_verify: false + image: gcr.io/kaniko-project/executor:latest + secrets: + - harbor_username + - harbor_password + commands: + # ساخت Docker config برای Harbor + - mkdir -p /kaniko/.docker + - echo "{\"auths\":{\"hub.peikarband.ir\":{\"username\":\"$${HARBOR_USERNAME}\",\"password\":\"$${HARBOR_PASSWORD}\"}}}" > /kaniko/.docker/config.json + # Build و Push به Harbor + - /kaniko/executor + --dockerfile=Dockerfile + --context=dir://. + --destination=hub.peikarband.ir/peikarband/landing:latest + --destination=hub.peikarband.ir/peikarband/landing:${CI_COMMIT_SHA:0:8} + --insecure=false + --skip-tls-verify=false + --digest-file=/kaniko/digest-file when: event: [push, tag, manual]