Jelajahi Sumber

Test a new image tagging

Vadim Surkov 6 tahun lalu
induk
melakukan
b4a77c48e5
1 mengubah file dengan 4 tambahan dan 0 penghapusan
  1. 4 0
      Jenkinsfile

+ 4 - 0
Jenkinsfile

@@ -1,3 +1,4 @@
+def NEWTAG
 pipeline {
   agent {
     label "swarm"
@@ -38,10 +39,13 @@ pipeline {
       steps {
         echo "Building ${DOCKER_REGISTRY}/iru/${DOCKER_IMAGE}:${repo}-${BUILD_NUMBER}."
         sh "docker build --build-arg repo=${repo} --no-cache -t ${DOCKER_REGISTRY}/iru/${DOCKER_IMAGE}:${repo}-${BUILD_NUMBER} ."
+        NEWTAG = sh script: "docker run --rm ${DOCKER_REGISTRY}/iru/${DOCKER_IMAGE}:${repo}-${BUILD_NUMBER} rpm -q --qf %{VERSION}-%{RELEASE} web-registry-admin 2> /dev/null", returnStdout: true
       }
     }
     stage("Publish") {
       steps {
+        echo "Tag is $NEWTAG"
+        error "Stop pipeline"
         echo "Publishing ${DOCKER_REGISTRY}/iru/${DOCKER_IMAGE}:${repo}-${BUILD_NUMBER}"
         sh "docker push ${DOCKER_REGISTRY}/iru/${DOCKER_IMAGE}:${repo}-${BUILD_NUMBER}"
       }