Running a command line instruction in HelloWorld plugin

24 views
Skip to first unread message

Bruno

unread,
Feb 20, 2015, 9:48:53 AM2/20/15
to jenkin...@googlegroups.com
Hi everyone,

I'm trying to develop a Jenkins plugin for some internal tools, and I'm a complete newbie. Basically, I just want to run some command line instructions, (then to collect data from reports generated by the previous instructions and to draw graphs). 

In the HelloWorld plugin, the only class is HelloWorldBuilder extending Builder. I assume that I have to write some lines in the "perform" method to run, say, a instruction like "mkdir new_folder".

How can I do this ? I've tried to use the BatchFile class to run a .bat (instead of a single instruction), but the javadoc page is quite empty..

Thx in advance.

Bruno

Mads Nielsen

unread,
Feb 20, 2015, 9:54:27 AM2/20/15
to jenkin...@googlegroups.com
i think you can use the launcher parameter in your perform. 

So like launcher.launch().pwd(build.getWorkspace()).cmdAsSingleString("mkdir new_folder").join()
 

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/a4e1d5d1-795d-4a14-9239-1d62767bbf85%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
____________________________________________________________
Mads Nielsen
Consultant
m...@praqma.net
+45 50 98 18 09
Skype: inkspot
Praqma
www.praqma.com
Allerød Stationsvej 4
DK-3450 Allerød
+45 36 77 27 62

Bruno

unread,
Feb 20, 2015, 10:11:28 AM2/20/15
to jenkin...@googlegroups.com
Works fine, thank you !
Reply all
Reply to author
Forward
0 new messages