Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-44834

Gradle pipeline support: withGradle and ConsoleAnnotator

      As a pipeline author who is creating pipelines for Gradle-based applications, I would like to be able to use Gradle tool definitions and console annotator in my pipeline scripts & declarative.

      Acceptance criteria:

      • There is a withGradle pipeline step which accepts two arguments: the tool definition name and a pipeline block wherein the given Gradle tool definition is available on the path as 'gradle'.
        • Any environment variables in the tool definition will be expanded
      • Any gradle executions triggered from within this pipeline block will be annotated with the Gradle ConsoleAnnotator so that user viewing the build console can easily navigate the console output.
        • The ConsoleAnnotation will be automatically applied within this withGradle step and the user will have no way to disable it.
      • There will be JenkinsRules which validate that a withGradle step works and that the console annotations are present in the build console of a pipeline run.

       

      This is being considered as part of the Important Pipeline Compatibility Epic. 

          [JENKINS-44834] Gradle pipeline support: withGradle and ConsoleAnnotator

          Alex Johnson added a comment -

          Getting close to cutting a PR to start review. Noting the following acceptance criteria issues for later discussion.

          Any environment variables in the tool definition will be expanded
          Conflicts with variable expansion in the pipeline devguide. Variables should be treated as literals.

          There is a withGradle pipeline step which accepts two arguments
          No problems with the block and gradle parameters. I think other config options could be added that would be useful and quick to implement. See the Pipeline Maven Plugin for examples of extra config options. The downside of course is they would have to be tested.

          Alex Johnson added a comment - Getting close to cutting a PR to start review. Noting the following acceptance criteria issues for later discussion. Any environment variables in the tool definition will be expanded Conflicts with variable expansion in the pipeline devguide . Variables should be treated as literals. There is a withGradle pipeline step which accepts two arguments No problems with the block and gradle parameters. I think other config options could be added that would be useful and quick to implement. See the Pipeline Maven Plugin for examples of extra config options. The downside of course is they would have to be tested.

          Sverre Moe added a comment -

          What is the status for this feature? Will it be done, and when can we expect it to be done?

          Sverre Moe added a comment - What is the status for this feature? Will it be done, and when can we expect it to be done?

          Stefan Wolf added a comment -

          djviking There is this PR: https://github.com/jenkinsci/gradle-plugin/pull/52. It seems like none of the authors is able to pick it up. And I don't know if it works on pipeline since I don't use it myself. So, if you want to give the PR a spin, please report your feedback there.

          Stefan Wolf added a comment - djviking There is this PR: https://github.com/jenkinsci/gradle-plugin/pull/52.  It seems like none of the authors is able to pick it up. And I don't know if it works on pipeline since I don't use it myself. So, if you want to give the PR a spin, please report your feedback there.

          Mark R added a comment - - edited

          It looks like the contents from the aforementioned PR are part of the plugin. Console annotations on pipelines worked for me with a out-of-the-box install so perhaps this issue may be closed?

          Note: Due to JENKINS-72411 it may not work when enabling the global timestamper setting

          Mark R added a comment - - edited It looks like the contents from the aforementioned PR are part of the plugin. Console annotations on pipelines worked for me with a out-of-the-box install so perhaps this issue may be closed? Note: Due to JENKINS-72411 it may not work when enabling the global timestamper setting

            wolfs Stefan Wolf
            recampbell Ryan Campbell
            Votes:
            6 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated: