Reading the $POM_VERSION in a groovy system (post) build step

2014-04-15 Thread dev123
I have a maven project where I define a groovy system (I need access to the jenkins DOM) post build step. In this step I need to read the POM__VERSION parameter modify it and export it as a new env. variable that can be used in the following build steps. Notice that configuring a shell post step

Where did the "Append Jenkins Build Number" in the m2-release plugin go?

2014-04-10 Thread dev123
Jenkins 1.558 I understand that "Append Jenkins Build Number" has been removed in the mvn-release plugin since it had no effect https://issues.jenkins-ci.org/browse/JENKINS-20753 But it is possible to get this feature to work automatically work somehow anyway? Before:

Re: Trigger a job Y after an artifact from job X has been released?

2014-04-10 Thread dev123
I now use the conditional trigger plugin where I set the boolean token to evaluate $IS_M2RELEASEBUILD. Works fine. On Wednesday, April 9, 2014 11:09:07 PM UTC+2, dev123 wrote: > > Ah yes. I have installed the promoted build plugin. I have then checked > (for some reason the sa

Bug in the promoted-build plugin when using release condition

2014-04-10 Thread dev123
It seems that the promoting a build based on a release condition is broken in the promoted build plugin (version 2.17). I have reported a bug: https://issues.jenkins-ci.org/browse/JENKINS-22565 Please comment or vote for this bug if you have the same problem. -- You received this message bec

Re: Trigger a job Y after an artifact from job X has been released?

2014-04-09 Thread dev123
Ah yes. I have installed the promoted build plugin. I have then checked (for some reason the same option appears twice): In a job *X*. Next I selected the job *a* to trigger under Action:

Trigger a job Y after an artifact from job X has been released?

2014-04-09 Thread dev123
I have a few maven projects A, B and C on Jenkins. I have configured the maven-release-plugin for the projects so I can release them with a single click on the release button. Now I have another project that picks up released artifacts, integrates them and runs a QA test. Currently I trigger th

Dynamically populate choice parameters

2014-04-08 Thread dev123
I am looking either for an existing plugin or suggestion for writing my own plugin that will give me the following functionality: On the job configuration page the user has access to one or more choice parameter drop-down menus. Now when the user clicks one of these drop-down boxes the values a

Cannot delete string parameter from job configuration

2014-04-02 Thread dev123
I have copied a Jenkins master to a new machine. Basically I just installed Jenkins (1.557) on the new machine and copied the plugins/jobs/config.xml etc. to the new machine after installing Jenkins. Everything seems to be up and running just fine. But when I try to delete a String parameter fr

Using the git plugin and specifying git branch

2014-03-30 Thread dev123
Jenkins1.549 Git plugin 1.5.0 I have a job in jenkins where I specify the following branch to build: origin/myfeature. I also have another job that is configured to build origin/master. Using strategy: Default Last Built Revision: Revision 1966b44e903862343c98c46f4a94d5a603a9a58f (origin/myfe

Running multiple TriggerBuilder in parallel from code using Jenkin API?

2014-03-16 Thread dev123
In a plugin I need to trigger multiple builds of a job in parallel (I have defined 4 executors on my slave). I have this: private TriggerBuilder createTriggerBuilder(List jobs) throws IOException { List configs = new ArrayList(); for (MyPOJO job : pojos) { // to let the

java.lang.NoClassDefFoundError: hudson/maven/MavenModuleSet

2014-03-15 Thread dev123
I am writing a jenkins plugin. In the plugin I have a class that extends Builder which has a method that checks if a given project is a MavenModuleSet: if (workerProject instanceof MavenModuleSet) { MavenModuleSet mavenModuleSet = (MavenModuleSet) workerProject; mavenModuleSet.se

Cannot create folder/file in slave home dir when running job on a slave

2014-03-10 Thread dev123
In a plugin I start a job on a slave and at some point I need to create a file in a folder in the jenkins home folder on the slave (/var/jenkins/sampleFolder). Its a hack but necessary for now. File outputDir = new File("/var/jenkins/sampleFolder/"); if (!outputDir.exists()) { outp

Re: Schedule a build in parallel from code (Jenkins API)

2014-03-09 Thread dev123
A my bad I of course had to call the correct job, it now works thanks :-) On Sunday, March 9, 2014 11:47:20 PM UTC+1, dev123 wrote: > > Yes I did a check in allow concurrent execution. > > Now when I run mvn clean hpi:run it starts the jobs in parallel on the > available exe

Re: Schedule a build in parallel from code (Jenkins API)

2014-03-09 Thread dev123
Yes I did a check in allow concurrent execution. Now when I run mvn clean hpi:run it starts the jobs in parallel on the available executors, but its spawns jobs infinitely and the text: Done in: " + object.getTime() is never printed. And I have not even pressed the build button. Why do I

Re: Schedule a build in parallel from code (Jenkins API)

2014-03-09 Thread dev123
e. > > On 09.03.2014, at 22:27, dev123 > wrote: > > > In a jenkins plugin I am writing I need to run 5 jobs in parallel. > Currently I do (sequentially): > > > > for (int i = 0; i < 4; i++) { > > try { > > buil

Schedule a build in parallel from code (Jenkins API)

2014-03-09 Thread dev123
In a jenkins plugin I am writing I need to run 5 jobs in parallel. Currently I do (sequentially): for (int i = 0; i < 4; i++) { try { build = project.scheduleBuild2(0, new Cause.UserCause(), myActions[i]).get(); } catch (Exception e) { throw new AbortException(e.g

Update existing job configuration parameter from code

2014-03-06 Thread dev123
In my plugin I need to dynamically update the values of a bunch of String parameters that the user specified when building a job ParametersAction params = project.getAction(ParametersAction.class); // How do we update existing parameters? StringParameterValue parameter = (StringParameterValue) pa

Add executors to a slave from code

2014-03-06 Thread dev123
I am working on a jenkins plugin where I need to simulate that my job can run on up to 10 executors. I have a test class that extends the JenkinsRule making it possible to create a DumbSlave like this: DumbSlave slave = jenkins.createSlave("mySlave", "myLabel", null); //slave.getComputer().getNo

Cannot write file to disk using the build Flow plugin

2014-03-04 Thread dev123
I have a build flow job where the first step I need to execute is writing a file to disk: Properties props = new Properties(); props.setProperty("Var1", "asdasd"); File f = new File("Configs.properties"); OutputStream out = new FileOutputStream( f ); props.store(out,null); When I run the job I

Re: For loop in the Jenkins build flow

2014-02-28 Thread dev123
gt;> for (int i=1; i<100; i++) { >> def curClosure = { >> build("a", STEP:i) >> } >> buildClosures.add(curClosure) >> } >> >> // execute the closures in buildClosures in parallel >> parallel(buildClosures) >> >> >

For loop in the Jenkins build flow

2014-02-22 Thread dev123
Is it possible to create a for loop in the jenkins build flow plugin DSL? Currently I have: parallel ( { build( "a", STEP: 1) }, { build( "a", STEP: 2 ) }, { build( "a", STEP: 3 ) } ) Which I need to scale to e.g. 100 parallel executions. Therefore I need to be able to do something like

Re: Groovy Plugin VS Build Flow Plugin

2014-01-09 Thread dev123
+1, Nicolas De loof wrote: > > build flow is an orchestration plugin, not a scripting one. The DSL is > actually groovy based, but should be used only to trigger jobs. > > > 2014/1/8 dev123 > > >> I have installed the Build Flow Plugin: >> https://wiki.jenki

Groovy Plugin VS Build Flow Plugin

2014-01-08 Thread dev123
I have installed the Build Flow Plugin: https://wiki.jenkins-ci.org/display/JENKINS/Build+Flow+Plugin making the Build Flow Job Type available. But this jobtype does not have the *Build Environment *configuration like the other jobtypes (freestyle, maven, etc.) which I need. I have also install