JBoss Management plugin support

18 views
Skip to first unread message

Deb

unread,
Jan 24, 2016, 7:50:04 AM1/24/16
to job-dsl-plugin
Hi All,

I am now stuck at another issue, one of my jobs use the JBoss Management plugin https://github.com/jenkinsci/jboss-plugin. This plugin has not been updated since last 4 years, however the plugin works for us. I am stuck on how to add a step for Starting/Stopping the JBoss server using this plugin. Is there a guide available on how add can the support in the Job DSL plugin? Also, does it need any code change in the original plugin (JBoss managememt in this case) itself to add any DSL support?

Thanks,

Debashish

Rui Fernando Hayashi

unread,
Jan 24, 2016, 11:29:23 AM1/24/16
to job-dsl...@googlegroups.com
You can use a configure block (https://github.com/jenkinsci/job-dsl-plugin/wiki/The-Configure-Block) to generate custom xml. To find the xml you need for your plugin, create a job manually and add the step you need. Look at the job's config.xml file at JENKINS_HOME/jobs/job-name/config.xml.

--
You received this message because you are subscribed to the Google Groups "job-dsl-plugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to job-dsl-plugi...@googlegroups.com.
To post to this group, send email to job-dsl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/job-dsl-plugin/bca8b1da-36d2-4b82-9636-01833a534d24%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Deb

unread,
Jan 25, 2016, 5:15:43 AM1/25/16
to job-dsl-plugin
Thanks a ton. And am delighted that I already started on that path last might after some Googling, however sadly I am stuck at the proper usage of the Configure block. The issue I am facing is that all the XML generated as result of configure block is getting placed at top of the "builder" block, instead of following the order in which the must be generated.

So instead of getting the following:
<builders>
<hudson.tasks.Shell>
<command>....</command>
</hudson.tasks.Shell>
<jenkins.plugins.publish__over__ssh.BapSshBuilderPlugin plugin="publish-...@1.13">
...
</jenkins.plugins.publish__over__ssh.BapSshBuilderPlugin>
<hudson.tasks.Shell>
<command>...</command>
</hudson.tasks.Shell>
<hudson.plugins.jboss.JBossBuilder plugin="jb...@1.0.6-SNAPSHOT">
<serverName>QA-Services</serverName>
<operation>
<type>START</type>
<stopOnFailure>false</stopOnFailure>
</operation>
</hudson.plugins.jboss.JBossBuilder>
<hudson.tasks.Shell>
<command>...</command>
</hudson.tasks.Shell>
</builders>

I get the following:
<builders>
<hudson.plugins.jboss.JBossBuilder plugin="jb...@1.0.6-SNAPSHOT">
<serverName>QA-Portal</serverName>
<operation>
<type>START</type>
<stopOnFailure>false</stopOnFailure>
</operation>
</hudson.plugins.jboss.JBossBuilder>

<hudson.tasks.Shell>
<command>...</command>
</hudson.tasks.Shell>
<jenkins.plugins.publish__over__ssh.BapSshBuilderPlugin>
...
</jenkins.plugins.publish__over__ssh.BapSshBuilderPlugin>
<hudson.tasks.Shell>
<command>...</command>
</hudson.tasks.Shell>
<hudson.tasks.Shell>
<command>...</command>
</hudson.tasks.Shell>
</builders>

I am using the following Groovy:
steps {
//read a script from workspace
shell('...')

//Stop the Portal Server
publishOverSsh {
server(portalJBossNode) {
transferSet {
execCommand('/jboss/jboss-eap-6.1/bin/StopServer.sh')
execTimeout(120000)
execInPty(true)
}
}
}
// Call script that undeploys WARs
// then stops the JBoss Services server
shell ('...')
//Start the JBOss Server
configure { 
 it / builders << 'hudson.plugins.jboss.JBossBuilder'(plugin: 'jb...@1.0.6-SNAPSHOT') {
serverName(servicesJBossNode) 
operation {
 type('START')
 stopOnFailure(false)
}
 }              
}
//Perform deployment
shell ('...')
}

Thanks a lot for your time to help.

Regards,

Deb
Message has been deleted

Rui Fernando Hayashi

unread,
Jan 25, 2016, 6:46:05 AM1/25/16
to job-dsl...@googlegroups.com
You have to invoke 'configure' outside of 'steps' method and then call 'steps' again to add the following steps. Like so:

steps {
   shell(...)

}

configure {
     it / builders << 'hudson.plugins.jboss.JBossBuilder'(plugin: 'jb...@1.0.6-SNAPSHOT') {
        serverName(servicesJBossNode)
        operation {
         type('START')
         stopOnFailure(false)
        }
     }             
}

steps {
   shell(...)
}


I think that's because 'steps' context doesn't actually have a 'configure' method, so when you invoke 'configure' inside 'steps' you're actually invoking the 'configure' inside the job context.

Hope it works.

Rui

Deb

unread,
Jan 25, 2016, 7:18:03 AM1/25/16
to job-dsl-plugin
Hi Rui,

Thanks so much again, worked like magic :)

Not exactly on this topic, but is there a tutorial on how to add on support for any missing plugins officially, I would really like to contribute for getting the JBoss plugin suppprt getting added. Appreciate the help.

Best,

Debashish

Rui Fernando Hayashi

unread,
Jan 25, 2016, 7:42:46 AM1/25/16
to job-dsl...@googlegroups.com
Haven't yet contributed to job-dsl-plugin :$

But, I think the Contributing Page (https://github.com/jenkinsci/job-dsl-plugin/blob/master/CONTRIBUTING.md) is the best place to start.

Reply all
Reply to author
Forward
0 new messages