adding kaniko

This commit is contained in:
areeqakbr 2025-02-25 09:32:11 +07:00
parent c243f41c62
commit a48212862c
1 changed files with 11 additions and 12 deletions

23
Jenkinsfile vendored
View File

@ -37,21 +37,20 @@ pipeline {
} }
stage('Build and Push Docker Image') { stage('Build and Push Docker Image') {
steps { steps {
script { container('kaniko') {
def imageTag = "dev-${env.SHORT_SHA}" script {
sh """ def imageTag = "dev-${env.SHORT_SHA}"
docker build -t ${REGISTRY_URL}/${IMAGE_NAME}:${imageTag} \ sh """
-t ${REGISTRY_URL}/${IMAGE_NAME}:dev \ /kaniko/executor --context=dir://. \
-t ${REGISTRY_URL}/${IMAGE_NAME}:latest \ --dockerfile=deploy/docker/Dockerfile \
-f deploy/docker/Dockerfile . --destination=${REGISTRY_URL}/${IMAGE_NAME}:${imageTag} \
docker push ${REGISTRY_URL}/${IMAGE_NAME}:${imageTag} --destination=${REGISTRY_URL}/${IMAGE_NAME}:dev \
docker push ${REGISTRY_URL}/${IMAGE_NAME}:dev --destination=${REGISTRY_URL}/${IMAGE_NAME}:latest
docker push ${REGISTRY_URL}/${IMAGE_NAME}:latest """
""" }
} }
} }
} }
stage('Deploy to Kubernetes') { stage('Deploy to Kubernetes') {
steps { steps {
script { script {