Update Jenkinsfile

This commit is contained in:
2026-02-16 17:27:17 +00:00
parent 872ad3ab78
commit e60e57d6f0

17
Jenkinsfile vendored
View File

@@ -20,12 +20,17 @@ pipeline {
stage('Build Image') {
steps {
sh """
docker build \
-t ${HARBOR_REGISTRY}/${HARBOR_PROJECT}/${IMAGE_NAME}:${BUILD_NUMBER} \
-t ${HARBOR_REGISTRY}/${HARBOR_PROJECT}/${IMAGE_NAME}:latest \
.
"""
// We use Kaniko to build the image safely inside Kubernetes
sh '''
docker run --rm \
-v .:/workspace \
-v /home/jenkins/.docker/config.json:/kaniko/.docker/config.json \
gcr.io/kaniko-project/executor:latest \
--dockerfile /workspace/Dockerfile \
--context /workspace \
--destination harbor.myriadcara.com/library/nodejs-app:1 \
--destination harbor.myriadcara.com/library/nodejs-app:latest
'''
}
}