fixe ci pipleine
Some checks failed
CD - Build & Deploy / release (push) Has been cancelled
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
CI / test (3.11) (push) Has been cancelled
CI / test (3.12) (push) Has been cancelled
CI / security (push) Has been cancelled
Some checks failed
CD - Build & Deploy / release (push) Has been cancelled
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
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:
@@ -2,16 +2,38 @@
|
||||
# Harbor registry: hub.peikarband.ir (مطابق با values-prd.yaml)
|
||||
|
||||
steps:
|
||||
# مرحله ساخت با Kaniko Executor (مستقیم - مطمئنتر از plugin)
|
||||
# مرحله Clone (برای debug و مشاهده لاگها)
|
||||
clone:
|
||||
image: plugins/git
|
||||
settings:
|
||||
depth: 50
|
||||
when:
|
||||
event: [push, tag, manual]
|
||||
|
||||
# مرحله ساخت با Kaniko Executor
|
||||
build-and-push:
|
||||
image: gcr.io/kaniko-project/executor:latest
|
||||
secrets:
|
||||
- harbor_username
|
||||
- harbor_password
|
||||
environment:
|
||||
# استفاده از secrets به عنوان environment variables
|
||||
HARBOR_USERNAME:
|
||||
from_secret: harbor_username
|
||||
HARBOR_PASSWORD:
|
||||
from_secret: harbor_password
|
||||
commands:
|
||||
# ساخت Docker config برای Harbor
|
||||
# نمایش اطلاعات برای debug
|
||||
- echo "Building for commit: ${CI_COMMIT_SHA}"
|
||||
- echo "Working directory: $(pwd)"
|
||||
- ls -la
|
||||
# ساخت Docker config برای Harbor (با استفاده از base64 encoding)
|
||||
- mkdir -p /kaniko/.docker
|
||||
- echo "{\"auths\":{\"hub.peikarband.ir\":{\"username\":\"$${HARBOR_USERNAME}\",\"password\":\"$${HARBOR_PASSWORD}\"}}}" > /kaniko/.docker/config.json
|
||||
- |
|
||||
AUTH=$(echo -n "${HARBOR_USERNAME}:${HARBOR_PASSWORD}" | base64 -w 0)
|
||||
echo "{\"auths\":{\"hub.peikarband.ir\":{\"auth\":\"${AUTH}\"}}}" > /kaniko/.docker/config.json
|
||||
# نمایش config (بدون password)
|
||||
- cat /kaniko/.docker/config.json | sed 's/"auth":"[^"]*"/"auth":"***"/g'
|
||||
# Build و Push به Harbor
|
||||
- /kaniko/executor
|
||||
--dockerfile=Dockerfile
|
||||
@@ -21,6 +43,7 @@ steps:
|
||||
--insecure=false
|
||||
--skip-tls-verify=false
|
||||
--digest-file=/kaniko/digest-file
|
||||
--verbosity=info
|
||||
when:
|
||||
event: [push, tag, manual]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user