Development environment

1,310 views
Skip to first unread message

Jeremy Marshall

unread,
Jun 14, 2013, 8:02:02 AM6/14/13
to job-dsl...@googlegroups.com
Hi

I liked job-dsl so much I decided to download the code to have a look at it. I also had a look at the jenkins demo plugin. So I have gradle too (Maven comes with my mac)

My question is, what is the best IDE to develop in? I tried Eclipse and then IntelliJ and think intelliJ integrates better but haven't found how to build it into the 
test Jenkins server I now seem to have. I suppose its the difference between maven and gradle. Do I need to drop into a shell to build?

Thanks 

Jeremy

Jeremy Marshall

unread,
Jun 14, 2013, 8:11:45 AM6/14/13
to job-dsl...@googlegroups.com
okay so I looked in the directory like I should have (IDE's keep that from you) and its 

./gradlew server

or from intellij  JetGradle plugin 'server' item

In my defence I am more a vi type of developer

Andrew Harmel-Law

unread,
Jun 14, 2013, 9:33:19 AM6/14/13
to job-dsl...@googlegroups.com
Hey Jeremy,

Thanks for your post.  I'm not sure about the other guys, but I'm on a corporate laptop (windows 7 enterprise) and swap between IntelliJ IDEA 12.1.4 and Netbeans 7.3.  I use their built-in git support / git bash (I'm trying to learn more about how git works) / SourceTree.  For builds, I, like you, build from the command line.  I know Netbeans used to have nice Jenkins development support, but that was a few years ago.

HTH

Anyone else want to share their dev platform?

Cheers, Andrew

--
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/4532e593-87fa-4d6c-a1a2-31d4e7d4997f%40googlegroups.com.

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

Chris Doré

unread,
Jun 23, 2013, 7:06:50 PM6/23/13
to job-dsl...@googlegroups.com
On both my Macbook and Win7 desktop I'm using a mix of commandline/gradle as well as IntelliJ (thanks to Justin's IntelliJ mini-tutorial at the Gradle Summit).  From what I heard at the Gradle Summit a few weeks ago, IntelliJ 13 should have even better/deeper gradle integration, but we'll see.

In addition to the server task, you might find the run task quite useful.  Using the run task allows you to generate config xml without having to fire up Jenkins.  If you're running the latest from master (or sometime after June 1st, when support for the args property was added):

Add some job dsl content to a file, say job.dsl
# ./gradlew run -Pargs=job.dsl
Note: the run task loads the file relative to the job-dsl-core directory, so I always just put my test files in there.
Note2: if your dsl code contains a task named "myJob", the run task will generate myJob.xml.


Chris

Andrew Harmel-Law

unread,
Jun 24, 2013, 2:57:00 AM6/24/13
to job-dsl...@googlegroups.com
--
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.

Chris Doré

unread,
Jun 24, 2013, 3:39:53 AM6/24/13
to job-dsl...@googlegroups.com
EDIT:

Note2: if your dsl code contains a job named "myJob",  the run task will generate myJob.xml.

I updated the wiki as well.


Chris

Andrew Harmel-Law

unread,
Jun 24, 2013, 3:40:16 AM6/24/13
to job-dsl...@googlegroups.com
Great.  Thanks.

Andrew

--
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.

Patrick Bruneton

unread,
Jul 31, 2013, 5:40:45 AM7/31/13
to job-dsl...@googlegroups.com
Hi,

This is nice.
I have to process a few DSL files (more than 150), and it takes quite some time if I run gradle each time.
Is there an easy way to process all files at once ?

Justin Ryan

unread,
Aug 1, 2013, 3:25:37 PM8/1/13
to job-dsl-plugin
It's a good idea. I just committed and pushed a fix to HEAD that will take multiple args. It'll be in 1.16.

I'd be curious to know what your "use case" is, to need to run more than 150 files on the command line.


--
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.

Patrick Bruneton

unread,
Aug 8, 2013, 6:14:11 AM8/8/13
to job-dsl...@googlegroups.com
In my company, we have many projects, and we want generate some jobs for each of them.
These jobs are configured using your plugin ! 

Chris Doré

unread,
Aug 8, 2013, 9:00:50 PM8/8/13
to job-dsl...@googlegroups.com
Hi Patrick,

You're generating these jobs by running the plugin from Jenkins though, right?  Justin is wondering about the use case for running so many job dsl files/projects through the commandline interface, which is mostly intended for testing and development of the plugin.


Chris

Patrick Bruneton

unread,
Aug 20, 2013, 6:01:28 AM8/20/13
to job-dsl...@googlegroups.com
Yes, I am generating these jobs using the plugin.
BTW, I noticed something which probably could be improved : sometimes, I generate a XML file which is not valid for Jenkins. The plugins says it has generated a job X, but when I click on the link the job X does not exist.
Could the plugin verifiy that the job has been actually created, and give the exception if it is not the case ?

Andrew Harmel-Law

unread,
Aug 20, 2013, 8:34:29 AM8/20/13
to job-dsl...@googlegroups.com
Hi Patrick,

Sounds like a nice feature request.  Do you want to have a try at adding it and submit a pull request?  If you need any help, post back here.

Cheers, Andrew

b...@shand.org.uk

unread,
Sep 13, 2013, 12:42:37 PM9/13/13
to job-dsl...@googlegroups.com
Hi Everyone,

Great work on the DSL plugin.  I'm using some parameters in our seed job.  Running through Jenkins is great - but is there a way I can specify the parameters when running on the the command line so that I can speed up my iteration time on my dev machine?

eg parameters = P4_DEPOT_PATH - that I want to use in my seed DSL.

Cheers

Bob

Alan Beale

unread,
Sep 20, 2013, 11:12:26 AM9/20/13
to job-dsl...@googlegroups.com

Bob,

  If you have 1.16 tag or later, you can create environment variables named after you parameters and then run the plugin from the command line.
  For example, assuming you have a parameter named P4_DEPOT_PATH on linux in bash you run the following
   export P4_DEPOT_PATH=/tmp/path_to_p4_depot
  ./gradlew :job-dsl-core:run -Pargs=/path/to/your/job-dsl-file

Alan

Pushkar Raste

unread,
May 15, 2014, 2:19:32 PM5/15/14
to job-dsl...@googlegroups.com
Hi,
I want to create jobs without firing Jenkins but from a template job. How does script knows where do my template job lives?

Baptiste Mathus

unread,
May 19, 2015, 7:52:50 AM5/19/15
to job-dsl...@googlegroups.com
Hi,

Sorry to excavate and old thread, but I tried using that and I guess what you refer to is the job-dsl repository? As I'm actually not hacking on the job-dsl repo itself, I haven't cloned it locally.

I used https://github.com/sheehan/job-dsl-gradle-example/ as a basis for our job dsl internal repository, and the run task is indeed unavailable with the included build.gradle.

I'm not gradle-savvy, but I seem to understand I could copy some parts of https://github.com/jenkinsci/job-dsl-plugin/blob/master/build.gradle#L73 inside my own build.gradle. 

I'm gonna test that. But I'd appreciate if someone could chime in and help about this, that'd be great (mainly meaning: how to make that tip usable outside the job-dsl's own build.gradle file, IIUC).

Thanks


Le lundi 24 juin 2013 01:06:50 UTC+2, Chris Doré a écrit :

Daniel Spilker

unread,
May 19, 2015, 9:11:21 AM5/19/15
to job-dsl...@googlegroups.com
You can't adopt the code from the job-dsl-plugin build files directly. Try to create a JavaExec Gradle task (https://gradle.org/docs/current/dsl/org.gradle.api.tasks.JavaExec.html) and set the main class to 'javaposse.jobdsl.Run'.

task run(dependsOn: 'classes', type: JavaExec) {
  main = 'javaposse.jobdsl.Run'
  classpath sourceSets.main.runtimeClasspath
  args 'jobs/test.groovy'
}

Daniel

--
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.

Baptiste Mathus

unread,
May 19, 2015, 4:13:59 PM5/19/15
to job-dsl...@googlegroups.com
Thanks a lot, that helped me get in the right direction. I renamed it debugxml locally and added to our dsl repo.


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



--
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !
Reply all
Reply to author
Forward
0 new messages