Jenkins Artifatory pipeline : How to promote a Debian package from a testing distribution to stable in the...











up vote
1
down vote

favorite












I have a Jenkins pipeline to build a .deb package. It successfully uploads the package to an Artifactory repository. The package itself is in the 'pool', and the metadata are created for the 'main' component and the 'testing' distribution. My preprod environment installs the package via APT.



What I would like to do now is to promote the build to the 'stable' distribution in the same repository (we have only one corporate Artifactory instance with lots of repositories, so I can't have several).



My pipeline looks like this:



#!/usr/bin/env groovy
node('XXX') {

def artifactoryServer
def artifactoryBuildInfo

stage('Artifactory configuration') {
artifactoryServer = Artifactory.newServer url: "http://mycorporateartifactoryrepo.com", credentialsId: 'XXXXX'
}

stage('checkout') {
checkout scm
}

stage('packaging & deploying') {
artifactoryBuildInfo = Artifactory.newBuildInfo()
// Packaging & deploying mvn
archiveArtifacts artifacts: "target/cowsay.deb", fingeprint: true

// packaging & deploying deb package
def uploadSpec = """{
"files": [
{
"pattern": "target/cowsay.deb",
"target": "debian-repo/pool/",
"props": "deb.distribution=testing;deb.component=main;deb.architecture=all"
}
]
}"""
artifactoryBuildInfo = artifactoryServer.upload spec: uploadSpec
artifactoryServer.publishBuildInfo artifactoryBuildInfo
}

stage('promotion') {
def promotionConfig = [
'buildName' : artifactoryBuildInfo.name,
'buildNumber' : artifactoryBuildInfo.number,
'sourceRepo' : 'debian-repo/pool/',
'targetRepo' : 'debian-repo/pool/',
'comment' : 'Promoting build',
'status' : 'Released',
'includeDependencies': true,
'copy' : true,
'failFast' : true
]

// Promote build interactively if tests are OK
Artifactory.addInteractivePromotion server: artifactoryServer, promotionConfig: promotionConfig, displayName: 'Promote me!'
}
}


How can I manage this? Artifactory does not document such a possibility. Do I need to create a custom pipeline to achieve this?



Thanks










share|improve this question




























    up vote
    1
    down vote

    favorite












    I have a Jenkins pipeline to build a .deb package. It successfully uploads the package to an Artifactory repository. The package itself is in the 'pool', and the metadata are created for the 'main' component and the 'testing' distribution. My preprod environment installs the package via APT.



    What I would like to do now is to promote the build to the 'stable' distribution in the same repository (we have only one corporate Artifactory instance with lots of repositories, so I can't have several).



    My pipeline looks like this:



    #!/usr/bin/env groovy
    node('XXX') {

    def artifactoryServer
    def artifactoryBuildInfo

    stage('Artifactory configuration') {
    artifactoryServer = Artifactory.newServer url: "http://mycorporateartifactoryrepo.com", credentialsId: 'XXXXX'
    }

    stage('checkout') {
    checkout scm
    }

    stage('packaging & deploying') {
    artifactoryBuildInfo = Artifactory.newBuildInfo()
    // Packaging & deploying mvn
    archiveArtifacts artifacts: "target/cowsay.deb", fingeprint: true

    // packaging & deploying deb package
    def uploadSpec = """{
    "files": [
    {
    "pattern": "target/cowsay.deb",
    "target": "debian-repo/pool/",
    "props": "deb.distribution=testing;deb.component=main;deb.architecture=all"
    }
    ]
    }"""
    artifactoryBuildInfo = artifactoryServer.upload spec: uploadSpec
    artifactoryServer.publishBuildInfo artifactoryBuildInfo
    }

    stage('promotion') {
    def promotionConfig = [
    'buildName' : artifactoryBuildInfo.name,
    'buildNumber' : artifactoryBuildInfo.number,
    'sourceRepo' : 'debian-repo/pool/',
    'targetRepo' : 'debian-repo/pool/',
    'comment' : 'Promoting build',
    'status' : 'Released',
    'includeDependencies': true,
    'copy' : true,
    'failFast' : true
    ]

    // Promote build interactively if tests are OK
    Artifactory.addInteractivePromotion server: artifactoryServer, promotionConfig: promotionConfig, displayName: 'Promote me!'
    }
    }


    How can I manage this? Artifactory does not document such a possibility. Do I need to create a custom pipeline to achieve this?



    Thanks










    share|improve this question


























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I have a Jenkins pipeline to build a .deb package. It successfully uploads the package to an Artifactory repository. The package itself is in the 'pool', and the metadata are created for the 'main' component and the 'testing' distribution. My preprod environment installs the package via APT.



      What I would like to do now is to promote the build to the 'stable' distribution in the same repository (we have only one corporate Artifactory instance with lots of repositories, so I can't have several).



      My pipeline looks like this:



      #!/usr/bin/env groovy
      node('XXX') {

      def artifactoryServer
      def artifactoryBuildInfo

      stage('Artifactory configuration') {
      artifactoryServer = Artifactory.newServer url: "http://mycorporateartifactoryrepo.com", credentialsId: 'XXXXX'
      }

      stage('checkout') {
      checkout scm
      }

      stage('packaging & deploying') {
      artifactoryBuildInfo = Artifactory.newBuildInfo()
      // Packaging & deploying mvn
      archiveArtifacts artifacts: "target/cowsay.deb", fingeprint: true

      // packaging & deploying deb package
      def uploadSpec = """{
      "files": [
      {
      "pattern": "target/cowsay.deb",
      "target": "debian-repo/pool/",
      "props": "deb.distribution=testing;deb.component=main;deb.architecture=all"
      }
      ]
      }"""
      artifactoryBuildInfo = artifactoryServer.upload spec: uploadSpec
      artifactoryServer.publishBuildInfo artifactoryBuildInfo
      }

      stage('promotion') {
      def promotionConfig = [
      'buildName' : artifactoryBuildInfo.name,
      'buildNumber' : artifactoryBuildInfo.number,
      'sourceRepo' : 'debian-repo/pool/',
      'targetRepo' : 'debian-repo/pool/',
      'comment' : 'Promoting build',
      'status' : 'Released',
      'includeDependencies': true,
      'copy' : true,
      'failFast' : true
      ]

      // Promote build interactively if tests are OK
      Artifactory.addInteractivePromotion server: artifactoryServer, promotionConfig: promotionConfig, displayName: 'Promote me!'
      }
      }


      How can I manage this? Artifactory does not document such a possibility. Do I need to create a custom pipeline to achieve this?



      Thanks










      share|improve this question















      I have a Jenkins pipeline to build a .deb package. It successfully uploads the package to an Artifactory repository. The package itself is in the 'pool', and the metadata are created for the 'main' component and the 'testing' distribution. My preprod environment installs the package via APT.



      What I would like to do now is to promote the build to the 'stable' distribution in the same repository (we have only one corporate Artifactory instance with lots of repositories, so I can't have several).



      My pipeline looks like this:



      #!/usr/bin/env groovy
      node('XXX') {

      def artifactoryServer
      def artifactoryBuildInfo

      stage('Artifactory configuration') {
      artifactoryServer = Artifactory.newServer url: "http://mycorporateartifactoryrepo.com", credentialsId: 'XXXXX'
      }

      stage('checkout') {
      checkout scm
      }

      stage('packaging & deploying') {
      artifactoryBuildInfo = Artifactory.newBuildInfo()
      // Packaging & deploying mvn
      archiveArtifacts artifacts: "target/cowsay.deb", fingeprint: true

      // packaging & deploying deb package
      def uploadSpec = """{
      "files": [
      {
      "pattern": "target/cowsay.deb",
      "target": "debian-repo/pool/",
      "props": "deb.distribution=testing;deb.component=main;deb.architecture=all"
      }
      ]
      }"""
      artifactoryBuildInfo = artifactoryServer.upload spec: uploadSpec
      artifactoryServer.publishBuildInfo artifactoryBuildInfo
      }

      stage('promotion') {
      def promotionConfig = [
      'buildName' : artifactoryBuildInfo.name,
      'buildNumber' : artifactoryBuildInfo.number,
      'sourceRepo' : 'debian-repo/pool/',
      'targetRepo' : 'debian-repo/pool/',
      'comment' : 'Promoting build',
      'status' : 'Released',
      'includeDependencies': true,
      'copy' : true,
      'failFast' : true
      ]

      // Promote build interactively if tests are OK
      Artifactory.addInteractivePromotion server: artifactoryServer, promotionConfig: promotionConfig, displayName: 'Promote me!'
      }
      }


      How can I manage this? Artifactory does not document such a possibility. Do I need to create a custom pipeline to achieve this?



      Thanks







      debian jenkins-pipeline artifactory






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited yesterday

























      asked yesterday









      Yann Poirier

      113




      113





























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53372132%2fjenkins-artifatory-pipeline-how-to-promote-a-debian-package-from-a-testing-dis%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53372132%2fjenkins-artifatory-pipeline-how-to-promote-a-debian-package-from-a-testing-dis%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

          SQL update select statement

          'app-layout' is not a known element: how to share Component with different Modules