A way to run deploy artefacts using the artifactory plugin from a workflow using configured Artifactory settings and with support for other features such as licensing checks.

          [JENKINS-30121] Workflow build step for Artifactory Plugin

          Code changed in jenkins
          User: Jesse Glick
          Path:
          COMPATIBILITY.md
          http://jenkins-ci.org/commit/workflow-plugin/b448a6311ee0b424c92eafbf8b265a40e8bca349
          Log:
          JENKINS-30121 Noting; closes #189.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: COMPATIBILITY.md http://jenkins-ci.org/commit/workflow-plugin/b448a6311ee0b424c92eafbf8b265a40e8bca349 Log: JENKINS-30121 Noting; closes #189.

          Jesse Glick added a comment -

          Is this intended to be distinct from existing Builder/Publisher implementations in this plugin? In what way?

          Jesse Glick added a comment - Is this intended to be distinct from existing Builder / Publisher implementations in this plugin? In what way?

          It should deploy the built artefacts to a repository on an artifactory server. If this can be achieved as easy as with the artifactory plugin with Builder/Publisher then I'd be happy to learn how.

          Stephan Leicht Vogt added a comment - It should deploy the built artefacts to a repository on an artifactory server. If this can be achieved as easy as with the artifactory plugin with Builder / Publisher then I'd be happy to learn how.

          Jesse Glick added a comment -

          Well the plugin already has a bunch of build steps and/or post-build actions which work in freestyle projects. The question is whether you simply expect some/all of those to work essentially the same way from a Workflow script (via the core step), which just requires implementing SimpleBuildStep and doing some corresponding fixups; or whether you are requesting a brand-new Workflow step with new behavior that has no direct analogue in freestyle projects.

          I do not know enough about this plugin’s features to recommend one or the other at the moment. Generally speaking it is easier to maintain a SimpleBuildStep since there is only one code path. In some cases functionality that is necessary in a freestyle project just does not make sense in a Workflow.

          Jesse Glick added a comment - Well the plugin already has a bunch of build steps and/or post-build actions which work in freestyle projects. The question is whether you simply expect some/all of those to work essentially the same way from a Workflow script (via the core step), which just requires implementing SimpleBuildStep and doing some corresponding fixups; or whether you are requesting a brand-new Workflow step with new behavior that has no direct analogue in freestyle projects. I do not know enough about this plugin’s features to recommend one or the other at the moment. Generally speaking it is easier to maintain a SimpleBuildStep since there is only one code path. In some cases functionality that is necessary in a freestyle project just does not make sense in a Workflow.

          The point is, that if I activate "Maven3-Artifactory Integration" in a freestyle project it automatically deploys all artefacts from "Invoke Maven 3" build steps as maven would if mvn deploy would have been called. So if I could also activate this plugin in the same manner in a workflow project I would excpect it also to deploy all artefacts from mvn-workflow-steps. I think for this to work the maven integration (https://issues.jenkins-ci.org/browse/JENKINS-26057) should also be solved, right?

          Stephan Leicht Vogt added a comment - The point is, that if I activate "Maven3-Artifactory Integration" in a freestyle project it automatically deploys all artefacts from "Invoke Maven 3" build steps as maven would if mvn deploy would have been called. So if I could also activate this plugin in the same manner in a workflow project I would excpect it also to deploy all artefacts from mvn-workflow-steps. I think for this to work the maven integration ( https://issues.jenkins-ci.org/browse/JENKINS-26057 ) should also be solved, right?

          Jesse Glick added a comment -

          Perhaps, though I have never been clear on the relation of the Maven build step defined in this plugin to the Maven build step defined in Jenkins core (a common source of user confusion).

          In the near term, just sh 'mvn deploy' if that is what you want to do. You can use the Config File Provider plugin (2.9.2+) with Workflow to keep a secure per-job settings.xml.

          Jesse Glick added a comment - Perhaps, though I have never been clear on the relation of the Maven build step defined in this plugin to the Maven build step defined in Jenkins core (a common source of user confusion). In the near term, just sh 'mvn deploy' if that is what you want to do. You can use the Config File Provider plugin (2.9.2+) with Workflow to keep a secure per-job settings.xml .

          Sure, with mvn deploy I can deploy my artefacts to my artifactory server (or any other maven server like i.e. nexus) but then I can't benefit as easily from the additional features from artifactory like licence check, capture build info or such. Sure I can call these things over the REST API from artifactory but that would be a "workaround". I think artifactory-plugin does exactly that but I do not have to worry about the REST API.

          Stephan Leicht Vogt added a comment - Sure, with mvn deploy I can deploy my artefacts to my artifactory server (or any other maven server like i.e. nexus) but then I can't benefit as easily from the additional features from artifactory like licence check, capture build info or such. Sure I can call these things over the REST API from artifactory but that would be a "workaround". I think artifactory-plugin does exactly that but I do not have to worry about the REST API.

          I think the plugin should also expose workflow features like capture build info.
          I did the workaround described by Stephan, but using Artifactory Rest API within Jenkins Workflow is really painfull.
          Artifactory Pro Integration (I.e. Discard old builds from Artifactory) could also leverage such plugin...

          Guillaume Théraud added a comment - I think the plugin should also expose workflow features like capture build info. I did the workaround described by Stephan, but using Artifactory Rest API within Jenkins Workflow is really painfull. Artifactory Pro Integration (I.e. Discard old builds from Artifactory) could also leverage such plugin...

          Actually it would be great to have at least the simplest 'Generic' deployment functionality available (when you specify some deployment rules). Is this possible? It is pain in the neck to call a different job and pass the build artifacts into it just for deployment, also have all build action badges in the different build and keep build rotation policy in sync..

          Nickolay Rumyantsev added a comment - Actually it would be great to have at least the simplest 'Generic' deployment functionality available (when you specify some deployment rules). Is this possible? It is pain in the neck to call a different job and pass the build artifacts into it just for deployment, also have all build action badges in the different build and keep build rotation policy in sync..

          Joseph Mocker added a comment -

          Second Nickolay's comments. Would be great to have all the features of the Artifactory plugin compatible with pipeline and multibranch-pipeline jobs. Sure I can get the core of what I need with "mvn deploy" but I like this being handled by Jenkins with all the bells and whistles.

          Joseph Mocker added a comment - Second Nickolay's comments. Would be great to have all the features of the Artifactory plugin compatible with pipeline and multibranch-pipeline jobs. Sure I can get the core of what I need with "mvn deploy" but I like this being handled by Jenkins with all the bells and whistles.

          JFrog worked on https://github.com/JFrogDev/project-examples/tree/master/jenkins-pipeline-examples.
          I did not test it, but i am pretty sure it is what we were looking for.

          Guillaume Théraud added a comment - JFrog worked on https://github.com/JFrogDev/project-examples/tree/master/jenkins-pipeline-examples . I did not test it, but i am pretty sure it is what we were looking for.

          Thanks for the great news! Looks nice but not yet released. Should be used with caution.

          Nickolay Rumyantsev added a comment - Thanks for the great news! Looks nice but not yet released. Should be used with caution.

          This issue can be probably resolved.
          Here's a link to the Artifactory Pipeline DSL documentation:
          https://wiki.jenkins-ci.org/display/JENKINS/Artifactory+-+Working+With+the+Pipeline+Jenkins+Plugin

          Eyal Ben Moshe added a comment - This issue can be probably resolved. Here's a link to the Artifactory Pipeline DSL documentation: https://wiki.jenkins-ci.org/display/JENKINS/Artifactory+-+Working+With+the+Pipeline+Jenkins+Plugin

          Jesse Glick added a comment -

          As the assignee you should resolve it if you think it is appropriate.

          Jesse Glick added a comment - As the assignee you should resolve it if you think it is appropriate.

            eyalbe Eyal Ben Moshe
            sleicht Stephan Leicht Vogt
            Votes:
            21 Vote for this issue
            Watchers:
            31 Start watching this issue

              Created:
              Updated:
              Resolved: