diff --git a/Jenkinsfile b/Jenkinsfile index 672183e8..b6ec5bca 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,6 +9,7 @@ pipeline { TEMP_IMAGE_NAME = "nginx-proxy-manager-build_${BUILD_NUMBER}" TEMP_IMAGE_NAME_ARM = "nginx-proxy-manager-armhf-build_${BUILD_NUMBER}" TAG_VERSION = getPackageVersion() + MAJOR_VERSION = "1" } stages { stage('Build') { @@ -35,15 +36,19 @@ pipeline { sh 'docker push $DOCKER_PRIVATE_REGISTRY/$IMAGE_NAME:latest' sh 'docker tag $TEMP_IMAGE_NAME ${DOCKER_PRIVATE_REGISTRY}/$IMAGE_NAME:$TAG_VERSION' sh 'docker push ${DOCKER_PRIVATE_REGISTRY}/$IMAGE_NAME:$TAG_VERSION' + sh 'docker tag $TEMP_IMAGE_NAME ${DOCKER_PRIVATE_REGISTRY}/$IMAGE_NAME:$MAJOR_VERSION' + sh 'docker push ${DOCKER_PRIVATE_REGISTRY}/$IMAGE_NAME:$MAJOR_VERSION' // Dockerhub sh 'docker tag $TEMP_IMAGE_NAME docker.io/jc21/$IMAGE_NAME:latest' sh 'docker tag $TEMP_IMAGE_NAME docker.io/jc21/$IMAGE_NAME:$TAG_VERSION' + sh 'docker tag $TEMP_IMAGE_NAME docker.io/jc21/$IMAGE_NAME:$MAJOR_VERSION' withCredentials([usernamePassword(credentialsId: 'jc21-dockerhub', passwordVariable: 'dpass', usernameVariable: 'duser')]) { sh "docker login -u '${duser}' -p '$dpass'" sh 'docker push docker.io/jc21/$IMAGE_NAME:latest' sh 'docker push docker.io/jc21/$IMAGE_NAME:$TAG_VERSION' + sh 'docker push docker.io/jc21/$IMAGE_NAME:$MAJOR_VERSION' } sh 'docker rmi $TEMP_IMAGE_NAME' @@ -73,15 +78,19 @@ pipeline { sh 'docker push $DOCKER_PRIVATE_REGISTRY/$IMAGE_NAME:latest-armhf' sh 'docker tag $TEMP_IMAGE_NAME_ARM ${DOCKER_PRIVATE_REGISTRY}/$IMAGE_NAME:$TAG_VERSION-armhf' sh 'docker push ${DOCKER_PRIVATE_REGISTRY}/$IMAGE_NAME:$TAG_VERSION-armhf' + sh 'docker tag $TEMP_IMAGE_NAME_ARM ${DOCKER_PRIVATE_REGISTRY}/$IMAGE_NAME:$MAJOR_VERSION-armhf' + sh 'docker push ${DOCKER_PRIVATE_REGISTRY}/$IMAGE_NAME:$MAJOR_VERSION-armhf' // Dockerhub sh 'docker tag $TEMP_IMAGE_NAME_ARM docker.io/jc21/$IMAGE_NAME:latest-armhf' sh 'docker tag $TEMP_IMAGE_NAME_ARM docker.io/jc21/$IMAGE_NAME:$TAG_VERSION-armhf' + sh 'docker tag $TEMP_IMAGE_NAME_ARM docker.io/jc21/$IMAGE_NAME:$MAJOR_VERSION-armhf' withCredentials([usernamePassword(credentialsId: 'jc21-dockerhub', passwordVariable: 'dpass', usernameVariable: 'duser')]) { sh "docker login -u '${duser}' -p '$dpass'" sh 'docker push docker.io/jc21/$IMAGE_NAME:latest-armhf' sh 'docker push docker.io/jc21/$IMAGE_NAME:$TAG_VERSION-armhf' + sh 'docker push docker.io/jc21/$IMAGE_NAME:$MAJOR_VERSION-armhf' } sh 'docker rmi $TEMP_IMAGE_NAME_ARM'