Loading Jenkinsfile +6 −7 Original line number Diff line number Diff line Loading @@ -3,13 +3,13 @@ def dockerImage pipeline { environment { imagename = "opensourcemano/api-fe" registryCredential = '<credentials>' // To be updated with actual ID in the future registryCredential = '' // To be updated with an explicit ID } agent any stages { stage('Build API-FE image') { steps{ sh "echo Building API-FE image" echo "Building API-FE image" script { dockerImage = docker.build "${env.imagename}:${env.BUILD_NUMBER}" } Loading @@ -17,20 +17,19 @@ pipeline { } stage('Upload to Docker registry') { steps{ sh "echo Here it would upload the image with appropriate tags: build number, latest" /*script { echo "Uploads the image with appropriate tags: build number, latest" script { docker.withRegistry( '', registryCredential ) { dockerImage.push("${env.BUILD_NUMBER}") dockerImage.push('latest') } }*/ } } } stage('Remove unused Docker image') { steps{ sh "docker rmi ${imagename}:${BUILD_NUMBER}" // Commented until "upload" stage can be uncommented as well //sh "docker rmi ${imagename}:latest" sh "docker rmi ${imagename}:latest" } } } Loading Loading
Jenkinsfile +6 −7 Original line number Diff line number Diff line Loading @@ -3,13 +3,13 @@ def dockerImage pipeline { environment { imagename = "opensourcemano/api-fe" registryCredential = '<credentials>' // To be updated with actual ID in the future registryCredential = '' // To be updated with an explicit ID } agent any stages { stage('Build API-FE image') { steps{ sh "echo Building API-FE image" echo "Building API-FE image" script { dockerImage = docker.build "${env.imagename}:${env.BUILD_NUMBER}" } Loading @@ -17,20 +17,19 @@ pipeline { } stage('Upload to Docker registry') { steps{ sh "echo Here it would upload the image with appropriate tags: build number, latest" /*script { echo "Uploads the image with appropriate tags: build number, latest" script { docker.withRegistry( '', registryCredential ) { dockerImage.push("${env.BUILD_NUMBER}") dockerImage.push('latest') } }*/ } } } stage('Remove unused Docker image') { steps{ sh "docker rmi ${imagename}:${BUILD_NUMBER}" // Commented until "upload" stage can be uncommented as well //sh "docker rmi ${imagename}:latest" sh "docker rmi ${imagename}:latest" } } } Loading