Pipeline DSL, IntelliJ, and maven

1,446 views
Skip to first unread message

Justin Knowles

unread,
Mar 2, 2017, 3:34:20 PM3/2/17
to Jenkins Users
Has anyone integrated a plugin with IntelliJ for editing a Jenkinsfile when writing Jenkins pipelines? Where can I find how to do this? I'm not seeing any plugins in the plugin repositories or on google, and the closest thing I've found to a howto was using Gradle and not maven, so I'm unsure of how to take those instructions and apply them to my setup.

Daniel Beck

unread,
Mar 2, 2017, 4:25:25 PM3/2/17
to jenkins...@googlegroups.com

> On 02.03.2017, at 21:34, Justin Knowles <jayc...@gmail.com> wrote:
>
> integrated a plugin with IntelliJ for editing a Jenkinsfile when writing Jenkins pipelines

There's a GDSL you can download from /pipeline-syntax that provides Pipeline syntax, would that work? If not, could you explain what you're asking for?

Justin Knowles

unread,
Mar 2, 2017, 4:50:46 PM3/2/17
to jenkins...@googlegroups.com
Is there a guide on what I do with that GDSL? If I'm understanding correctly the instructions here (https://st-g.de/2016/08/jenkins-pipeline-autocompletion-in-intellij) say:
1. take the raw GDSL from /pipeline-syntax
2. drop it into a file called pipeline.gdsl
3. put it somehwere on the classpath

I've done that but I'm not seeing any syntax highlighting or autocompletion in my Jenkinsfile. I'm not developing a plugin for Jenkins or anything, I just want IntelliJ to recognize the Jenkinsfile and provide highlighting, style fixes, etc.


--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/S0_etu_70oY/unsubscribe.
To unsubscribe from this group and all its topics, 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/6EAEF958-C442-4A3B-BA0A-CFAE41050335%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.

Daniel Beck

unread,
Mar 2, 2017, 5:19:43 PM3/2/17
to jenkins...@googlegroups.com

> On 02.03.2017, at 22:49, Justin Knowles <jayc...@gmail.com> wrote:
>
> I've done that but I'm not seeing any syntax highlighting or autocompletion in my Jenkinsfile. I'm not developing a plugin for Jenkins or anything, I just want IntelliJ to recognize the Jenkinsfile and provide highlighting, style fixes, etc.

The instructions on https://confluence.jetbrains.com/display/GRVY/Scripting+IDE+for+DSL+awareness don't work? (Instead of writing the GDSL from scratch, just paste the provided one in.)

Justin Knowles

unread,
Mar 2, 2017, 6:13:35 PM3/2/17
to jenkins...@googlegroups.com
Not trying to be obtuse, but are there even install instructions on that page or directions for how to get IntelliJ to understand GroovyDSL/Jenkinsfile? I see the "Describing GroovyDSL internal language in its own terms" section mentioning IDEA PSI but I have no idea where it is or how to set it up? Am I looking at the right section? This is for an existing project, FWIW.

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/S0_etu_70oY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-users+unsubscribe@googlegroups.com.

Daniel Beck

unread,
Mar 2, 2017, 7:02:07 PM3/2/17
to jenkins...@googlegroups.com

> On 03.03.2017, at 00:12, Justin Knowles <jayc...@gmail.com> wrote:
>
> are there even install instructions on that page or directions for how to get IntelliJ to understand GroovyDSL/Jenkinsfile?

It works for me with IntelliJ 2016.3.4.

Steps:

1. Create a new Java project with Groovy dependency.
2. Right-click 'src', New, Groovy Script, call it 'dsl' and select kind 'GroovyDSL script'.
3. Paste in the output from Jenkins and save.
4. 'Activate back'
5. Right-click 'src', New, Groovy Script, call it 'Jenkinsfile' and select kind 'Groovy script'.
6. Paste in your Jenkinsfile
7. Enjoy autocompletion etc.

Indra Gunawan (ingunawa)

unread,
Mar 3, 2017, 2:15:38 AM3/3/17
to jenkins...@googlegroups.com
Somehow is there other IDE that can be supported. Can Jenkinsfile syntax hightlighting be supported in SublimeText and recently Visual Studio Code.

Thank you
--
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/20131B21-731E-4614-A2DF-A44BF686FC16%40beckweb.net.

Justin Knowles

unread,
Mar 3, 2017, 2:39:32 PM3/3/17
to jenkins...@googlegroups.com
Cool, that worked, thanks Daniel. Last question (I think) - is there a way to have autocompletion work in other existing projects without them being a Groovy project or having that DSL file in the codebase?

Thanks again for your help.

On Fri, Mar 3, 2017 at 2:15 AM, Indra Gunawan (ingunawa) <ingu...@cisco.com> wrote:
Somehow is there other IDE that can be supported.  Can Jenkinsfile syntax hightlighting be supported in SublimeText and recently Visual Studio Code.

Thank you


On 3/2/17, 4:01 PM, "jenkinsci-users@googlegroups.com on behalf of Daniel Beck" <jenkinsci-users@googlegroups.com on behalf of m...@beckweb.net> wrote:


    > On 03.03.2017, at 00:12, Justin Knowles <jayc...@gmail.com> wrote:
    >
    > are there even install instructions on that page or directions for how to get IntelliJ to understand GroovyDSL/Jenkinsfile?

    It works for me with IntelliJ 2016.3.4.

    Steps:

    1. Create a new Java project with Groovy dependency.
    2. Right-click 'src', New, Groovy Script, call it 'dsl' and select kind 'GroovyDSL script'.
    3. Paste in the output from Jenkins and save.
    4. 'Activate back'
    5. Right-click 'src', New, Groovy Script, call it 'Jenkinsfile' and select kind 'Groovy script'.
    6. Paste in your Jenkinsfile
    7. Enjoy autocompletion etc.

    --
    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-users+unsubscribe@googlegroups.com.
--

You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/S0_etu_70oY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-users+unsubscribe@googlegroups.com.

David Karlsen

unread,
Mar 3, 2017, 3:26:30 PM3/3/17
to jenkins...@googlegroups.com
Not to my knowledge - I asked JetBrains about it - but you can also add a file with a .gdsl extension with the DSL in it AFAIR.


For more options, visit https://groups.google.com/d/optout.



--

Rafael Pestano

unread,
Oct 21, 2017, 6:10:46 PM10/21/17
to Jenkins Users
Hi Indra,

for sublime text there is this plugin: https://github.com/bjarneo/jenkinsfile-syntax

I've tested on linux/Ubuntu and worked like a charm. Just clone the repository into 
.config/sublime-text-3/Packages/

 and restart sublime.
Reply all
Reply to author
Forward
0 new messages