fixe ci pipleine
Some checks failed
ci/woodpecker/push/woodpecker Pipeline 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
Some checks failed
ci/woodpecker/push/woodpecker Pipeline 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:
@@ -1,20 +1,39 @@
|
|||||||
variables:
|
# Peikarband Platform - Woodpecker CI/CD Pipeline
|
||||||
- ®istry "hub.peikarband.ir" # مطمئن شوید دامنه دقیقاً همین است
|
# Harbor: hub.peikarband.ir
|
||||||
- &repo "peikarband/landing"
|
# Project: peikarband (created)
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
build:
|
build-and-push:
|
||||||
image: plugins/kaniko
|
image: gcr.io/kaniko-project/executor:debug
|
||||||
settings:
|
environment:
|
||||||
registry: *registry
|
HARBOR_USERNAME:
|
||||||
repo: *repo
|
|
||||||
tags:
|
|
||||||
- latest
|
|
||||||
- ${CI_COMMIT_SHA:0:8}
|
|
||||||
# متغیرها باید دقیقاً با این کلیدها در settings باشند
|
|
||||||
username:
|
|
||||||
from_secret: harbor_username
|
from_secret: harbor_username
|
||||||
password:
|
HARBOR_PASSWORD:
|
||||||
from_secret: harbor_password
|
from_secret: harbor_password
|
||||||
|
commands:
|
||||||
|
- mkdir -p /kaniko/.docker
|
||||||
|
- |
|
||||||
|
# استفاده از environment variables یا مقادیر پیشفرض
|
||||||
|
# چک میکنیم که آیا متغیرها خالی هستند یا نه
|
||||||
|
if [ -z "${HARBOR_USERNAME}" ] || [ "${HARBOR_USERNAME}" = "" ]; then
|
||||||
|
USERNAME="admin"
|
||||||
|
else
|
||||||
|
USERNAME="${HARBOR_USERNAME}"
|
||||||
|
fi
|
||||||
|
if [ -z "${HARBOR_PASSWORD}" ] || [ "${HARBOR_PASSWORD}" = "" ]; then
|
||||||
|
PASSWORD="5459ed7590d37656410fae38bdf59eb7ee33b68cd4c"
|
||||||
|
else
|
||||||
|
PASSWORD="${HARBOR_PASSWORD}"
|
||||||
|
fi
|
||||||
|
# ساخت Docker config
|
||||||
|
AUTH=$(echo -n "${USERNAME}:${PASSWORD}" | base64 -w 0)
|
||||||
|
echo "{\"auths\":{\"hub.peikarband.ir\":{\"auth\":\"${AUTH}\"}}}" > /kaniko/.docker/config.json
|
||||||
|
- /kaniko/executor
|
||||||
|
--dockerfile=Dockerfile
|
||||||
|
--context=dir://.
|
||||||
|
--destination=hub.peikarband.ir/peikarband/landing:latest
|
||||||
|
--destination=hub.peikarband.ir/peikarband/landing:${CI_COMMIT_SHA:0:8}
|
||||||
|
--skip-tls-verify=false
|
||||||
|
--verbosity=info
|
||||||
when:
|
when:
|
||||||
event: [push, tag, manual]
|
event: [push, tag, manual]
|
||||||
Reference in New Issue
Block a user