Update Jenkinsfile

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

21
Jenkinsfile vendored
View File

@@ -19,15 +19,20 @@ pipeline {
} }
stage('Build Image') { stage('Build Image') {
steps { steps {
sh """ // We use Kaniko to build the image safely inside Kubernetes
docker build \ sh '''
-t ${HARBOR_REGISTRY}/${HARBOR_PROJECT}/${IMAGE_NAME}:${BUILD_NUMBER} \ docker run --rm \
-t ${HARBOR_REGISTRY}/${HARBOR_PROJECT}/${IMAGE_NAME}:latest \ -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
'''
} }
}
stage('Push to Harbor') { stage('Push to Harbor') {
steps { steps {