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

should be able to validate a declarative pipeline from a pipeline step

    XMLWordPrintable

Details

    Description

      Currently to validate a declarative pipeline you need to either use curl or ssh.

      Adding an ssh key or other credentials so you can access back to Jenkins from within Jenkins itself is a sign that something is terribly terribly wrong - so please can we have a step that we can call from a pipeline to validate a different pipeline?

      Attachments

        Issue Links

          Activity

            +1, I think the use case for CLI is still valid to be able to validate your work on your dev box progressively/before pushing. But would make life easier to have a pipeline step: we would then have more easily a PR build for modifications against Jenkinsfile itself.
            Thanks!

            batmat Baptiste Mathus added a comment - +1, I think the use case for CLI is still valid to be able to validate your work on your dev box progressively/before pushing. But would make life easier to have a pipeline step: we would then have more easily a PR build for modifications against Jenkinsfile itself. Thanks!

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/steps/ValidateDeclarativePipelineStep.java
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/AbstractModelDefTest.java
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/steps/ValidateDeclarativePipelineStepTest.java
            pipeline-model-definition/src/test/resources/validateDeclarativePipelineStep.groovy
            http://jenkins-ci.org/commit/pipeline-model-definition-plugin/bc6c17770181604fc648d775c6adb2162c9a4e2f
            Log:
            [FIXED JENKINS-42168] Add validateDeclarativePipeline(path) step

            Given a path to a file containing a Declarative Pipeline to validate,
            this will read that file from the workspace, validate its contents,
            echo out relevant errors to the build log, and return true if the
            contents validated, or false other wise.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/steps/ValidateDeclarativePipelineStep.java pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/AbstractModelDefTest.java pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/steps/ValidateDeclarativePipelineStepTest.java pipeline-model-definition/src/test/resources/validateDeclarativePipelineStep.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/bc6c17770181604fc648d775c6adb2162c9a4e2f Log: [FIXED JENKINS-42168] Add validateDeclarativePipeline(path) step Given a path to a file containing a Declarative Pipeline to validate, this will read that file from the workspace, validate its contents, echo out relevant errors to the build log, and return true if the contents validated, or false other wise.

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/steps/ValidateDeclarativePipelineStep.java
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/steps/ValidateDeclarativePipelineStep/config.jelly
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/steps/ValidateDeclarativePipelineStep/help-path.html
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/steps/ValidateDeclarativePipelineStep/help.html
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/AbstractModelDefTest.java
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/steps/ValidateDeclarativePipelineStepTest.java
            pipeline-model-definition/src/test/resources/validateDeclarativePipelineStep.groovy
            http://jenkins-ci.org/commit/pipeline-model-definition-plugin/d0bdbf7c606e0cfceaafd050e9693c0d89de1f0a
            Log:
            Merge pull request #121 from abayer/jenkins-42168

            [FIXED JENKINS-42168] Add validateDeclarativePipeline(path) step

            Compare: https://github.com/jenkinsci/pipeline-model-definition-plugin/compare/c40dd713c51b...d0bdbf7c606e

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/steps/ValidateDeclarativePipelineStep.java pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/steps/ValidateDeclarativePipelineStep/config.jelly pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/steps/ValidateDeclarativePipelineStep/help-path.html pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/steps/ValidateDeclarativePipelineStep/help.html pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/AbstractModelDefTest.java pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/steps/ValidateDeclarativePipelineStepTest.java pipeline-model-definition/src/test/resources/validateDeclarativePipelineStep.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/d0bdbf7c606e0cfceaafd050e9693c0d89de1f0a Log: Merge pull request #121 from abayer/jenkins-42168 [FIXED JENKINS-42168] Add validateDeclarativePipeline(path) step Compare: https://github.com/jenkinsci/pipeline-model-definition-plugin/compare/c40dd713c51b...d0bdbf7c606e

            Cool! Thanks abayer

            batmat Baptiste Mathus added a comment - Cool! Thanks abayer
            bitwiseman Liam Newman added a comment -

            Bulk closing resolved issues.

            bitwiseman Liam Newman added a comment - Bulk closing resolved issues.

            People

              abayer Andrew Bayer
              teilo James Nord
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: