Update Jenkinsfile
This commit is contained in:
21
Jenkinsfile
vendored
21
Jenkinsfile
vendored
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user