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

CLI command for Declarative linter

    XMLWordPrintable

Details

    Description

      We need a command-line linter - the Jenkins CLI is right there, so let's take advantage of it!

      Attachments

        Issue Links

          Activity

            abayer Andrew Bayer created issue -
            abayer Andrew Bayer made changes -
            Field Original Value New Value
            Status Open [ 1 ] In Progress [ 3 ]
            abayer Andrew Bayer made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            abayer Andrew Bayer added a comment - Initial PR up at https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/58
            abayer Andrew Bayer made changes -
            Remote Link This issue links to "PR #58 (Web Link)" [ 15066 ]
            abayer Andrew Bayer added a comment -

            Still debating also adding a shell script that you can download and run without needing to have CLI SSH port access to the master. Haven't decided yet.

            abayer Andrew Bayer added a comment - Still debating also adding a shell script that you can download and run without needing to have CLI SSH port access to the master. Haven't decided yet.

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/DeclarativeLinterCommand.java
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/Messages.properties
            http://jenkins-ci.org/commit/pipeline-model-definition-plugin/ad5731247cfbb3f83597e9c122d04825f17d6068
            Log:
            [FIXED JENKINS-39923] Add a CLI endpoint for the linter

            Can be used like:

            ```
            ssh -p [sshd port on master] localhost declarative-linter < Jenkinsfile
            ```

            Tweaks still needed for permissions (right now, it's anyone with read
            access, which, I think, is OK) and possibly reading the file reading
            than just taking it from stdin.

            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/DeclarativeLinterCommand.java pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/Messages.properties http://jenkins-ci.org/commit/pipeline-model-definition-plugin/ad5731247cfbb3f83597e9c122d04825f17d6068 Log: [FIXED JENKINS-39923] Add a CLI endpoint for the linter Can be used like: ``` ssh -p [sshd port on master] localhost declarative-linter < Jenkinsfile ``` Tweaks still needed for permissions (right now, it's anyone with read access, which, I think, is OK) and possibly reading the file reading than just taking it from stdin.
            abayer Andrew Bayer made changes -
            Resolution Fixed [ 1 ]
            Status In Review [ 10005 ] Resolved [ 5 ]

            Hi, I'm having trouble finding the CLI. I'm using docker.

            $ cat Dockerfile.pipeline 
            FROM jenkins:2.46.1-alpine
            
            RUN /usr/local/bin/install-plugins.sh \
                    pipeline-model-definition
            

            When I run the image, I can't find declarative-linter anywhere. Am I missing an install step?

            thanks,

            bhenderson Brian Henderson added a comment - Hi, I'm having trouble finding the CLI. I'm using docker. $ cat Dockerfile.pipeline FROM jenkins:2.46.1-alpine RUN /usr/local/bin/install-plugins.sh \ pipeline-model-definition When I run the image, I can't find declarative-linter anywhere. Am I missing an install step? thanks,
            bitwiseman Liam Newman added a comment -

            Bulk closing resolved issues.

            bitwiseman Liam Newman added a comment - Bulk closing resolved issues.
            bitwiseman Liam Newman made changes -
            Status Resolved [ 5 ] Closed [ 6 ]

            People

              abayer Andrew Bayer
              abayer Andrew Bayer
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: