Linting Jenkinsfile

406 views
Skip to first unread message

Mayur Nagekar

unread,
Jan 16, 2018, 2:34:30 AM1/16/18
to Jenkins Users
Hello all,

I have been trying to find a way to lint Jenkinsfile and came across https://jenkins.io/doc/book/pipeline/development/#linter but this hasn't helped unfortunately.
Every time I try to run the command, I get

bash: declarative-linter: command not found

Looks like there are some additional installs (may be plugins) that need to happen on jenkins server? I'd appreciate if someone could enlighten me on the same.

Many thanks,
Mayur 

niristotle okram

unread,
Jan 16, 2018, 2:40:17 AM1/16/18
to jenkins...@googlegroups.com
Somethings that you need to add in your help request: 
1. How are connecting to the server cli/curl? 
2. What kind of jenkinsfile your are attempting to lint? Declarative or scripted pipeline?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/0c9846b3-3bc6-44a6-8de3-5a3ab6cc9d91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Sent from mobile device, excuse typos if any.

Dirk Heinrichs

unread,
Jan 16, 2018, 2:50:40 AM1/16/18
to jenkins...@googlegroups.com
Am 16.01.2018 um 08:34 schrieb Mayur Nagekar:

bash: declarative-linter: command not found

Is the directory containing declarative-linter in your $PATH?

HTH...

    Dirk
--
Dirk Heinrichs
Senior Systems Engineer, Delivery Pipeline
OpenTextTM Discovery | Recommind
Email: dirk.he...@recommind.com
Website: www.recommind.de

Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach

Vertretungsberechtigte Geschäftsführer John Marshall Doolittle, Gordon Davies, Roger Illing, Registergericht Amtsgericht Bonn, Registernummer HRB 10646

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet.

Mayur Nagekar

unread,
Jan 16, 2018, 3:24:17 AM1/16/18
to Jenkins Users
ssh -i ~/.ssh/id_rsa_jenkins -p 22 <HOST_IP> declarative-linter < Jenkinsfile

I have been trying to test a declarative pipeline style Jenkinfile.

@ok999

Mayur Nagekar

unread,
Jan 16, 2018, 3:25:02 AM1/16/18
to Jenkins Users
I have no idea where that comes from ? And thats why my question.

Mayur Nagekar

unread,
Jan 16, 2018, 3:25:26 AM1/16/18
to Jenkins Users
ssh -~/.ssh/id_rsa_jenkins -22 <HOST_IP> declarative-linter < Jenkinsfile

I have been trying to test a declarative pipeline style Jenkinfile.

Dirk Heinrichs

unread,
Jan 16, 2018, 3:35:07 AM1/16/18
to jenkins...@googlegroups.com
Am 16.01.2018 um 09:25 schrieb Mayur Nagekar:

I have no idea where that comes from ? And thats why my question.

Well, according to your other reply you do:


ssh -i ~/.ssh/id_rsa_jenkins -p 22 <HOST_IP> declarative-linter < Jenkinsfile

So, you want to execute a program (declarative-linter in this case) on a remote host, but it is not found. Its directory either needs to be in the $PATH variable (on that remote host) or you need to specify the complete path, as in

ssh -i ~/.ssh/id_rsa_jenkins -p 22 <HOST_IP> /full/path/to/declarative-linter < Jenkinsfile

Richard Bywater

unread,
Jan 16, 2018, 3:38:22 AM1/16/18
to jenkins...@googlegroups.com
Hi Mayur

You need to connect to Jenkins' SSH port and not the system port number. See https://wiki.jenkins.io/display/JENKINS/Jenkins+SSH for more info.

Richard.

Mayur Nagekar

unread,
Jan 16, 2018, 4:23:40 AM1/16/18
to Jenkins Users
Hi Richard,

How do I configure the sshd port for jenkins ? Can you guide me ?

Thanks,
Mayur

Benjamin Lau

unread,
Jan 16, 2018, 4:32:57 AM1/16/18
to Jenkins Users
Hey Mayur,

Check in the Manage Jenkins menu. If you search for sshd you should find it pretty quick. :-)

<jenkinsurl>/configure

Ben
P.S. How's it hanging former co-worker?

To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e89f5eba-3e12-4c4d-90ad-6038db9f651c%40googlegroups.com.

Mayur Nagekar

unread,
Jan 16, 2018, 5:00:52 AM1/16/18
to Jenkins Users
Hey Ben,

Thank you for looking into it. I checked <jenkinsurl>/configure as the first step but didn't find much there :(
Is it that I need some plugin to be installed for it ?

Thanks,
Mayur

P.S I am good. Really ecstatic to hear from you. Looks like your love for jenkins is still alive and kicking :)

Richard Bywater

unread,
Jan 16, 2018, 5:21:20 AM1/16/18
to jenkins...@googlegroups.com
Configuration details are provided in the page I linked to in my previous email. 

Richard 

Daniel Beck

unread,
Jan 16, 2018, 5:30:49 AM1/16/18
to jenkins...@googlegroups.com

> On 16. Jan 2018, at 11:00, Mayur Nagekar <mayur....@gmail.com> wrote:
>
> Thank you for looking into it. I checked <jenkinsurl>/configure as the first step but didn't find much there :(
> Is it that I need some plugin to be installed for it ?
>

Since Jenkins 2.51 the SSHD port configuration is part of the security configuration form.

Mayur Nagekar

unread,
Jan 16, 2018, 5:54:05 AM1/16/18
to Jenkins Users
Hi Daniel,

Many thanks for letting me know and updating the page with the right information.

Thanks,
Mayur
Reply all
Reply to author
Forward
0 new messages