Re: Build flow plugin: How to copy results from downstream jobs

2013-01-02 Thread nicolas de loof
sure, rescue handle whatever happens in gard block, that has no restriction
on nested content

2013/1/3 Patrick van der Velde 

> Thanks for that suggestion. One question about the guard statement. Can it
> handle multiple statements? i.e. is the following allowed?
>
> guard {
> build("job1")
> build("job2")
> } rescue {
> build("finaljob")
> }
>
> or even this
>
> guard {
> parallel(
> { build("job1a") },
> { build("job2a") },
> )
>
> parallel(
> { build("job1b") },
> { build("job2b") },
> )
> } rescue {
> build("finaljob")
> }
>
> My script looks a bit like that last one but when I tried putting a guard
> clause around it I got the following error:
>
>
> ERROR: Failed to run DSL Scriptgroovy.lang.MissingMethodException 
> :
>  No signature of method: com.cloudbees.plugins.flow.FlowDelegate.rescue() is 
> applicable for argument types: (Script1$_run_closure1_closure3) values:
>
>
> Removing the guard clause made it work. So I'm guessing guard can only
> handle 1 item?
>
> Thanks
>
> Petrik
>
>
> On Wed, Jan 2, 2013 at 10:16 PM, nicolas de loof  > wrote:
>
>> use gard+rescue so you can execute a post-job even when some jobs are
>> unstable
>>
>>
>> 2013/1/2 Patrick 
>>
>>> Ok I'm going to have to amend this answer. My idea of having a separate
>>> job at the end to gather the results would work if it wasn't for the fact
>>> that the build flow plugin kills the build as soon as one of the jobs
>>> fails. That means I only can get the results if the build works which is
>>> not what I want. I want the results gathering to always take place, even if
>>> the all the build jobs fail. Any way to achieve this?
>>>
>>> Thanks
>>>
>>> Petrik
>>>
>>>
>>> On Wednesday, 2 January 2013 11:46:54 UTC+13, Patrick wrote:

 Hi

 Mmm ok, I guess I could create a separate job to gather all the test
 results. Thanks for the advice :)

 Regards

 Petrik




>>
>


Re: Need help for dropdownDescriptorSelector

2013-01-02 Thread domi
https://github.com/jenkinsci/run-condition-plugin/blob/master/src/main/resources/org/jenkins_ci/plugins/run_condition/logic/ConditionContainer/config.jelly
/Domi

On 02.01.2013, at 09:39, Adil Shabbir  wrote:

> Hi! All,
> 
> Wish you all a very Happy new Year-2013
> 
> Can any one point out the sample code(jelly and java) how to use 
> 'dropdownDescriptorSelector' in Jenkins plugin.
> 
> Adil



Re: Build flow plugin: How to copy results from downstream jobs

2013-01-02 Thread Patrick van der Velde
Thanks for that suggestion. One question about the guard statement. Can it
handle multiple statements? i.e. is the following allowed?

guard {
build("job1")
build("job2")
} rescue {
build("finaljob")
}

or even this

guard {
parallel(
{ build("job1a") },
{ build("job2a") },
)

parallel(
{ build("job1b") },
{ build("job2b") },
)
} rescue {
build("finaljob")
}

My script looks a bit like that last one but when I tried putting a guard
clause around it I got the following error:

ERROR: Failed to run DSL Scriptgroovy.lang.MissingMethodException
:
No signature of method:
com.cloudbees.plugins.flow.FlowDelegate.rescue() is applicable for
argument types: (Script1$_run_closure1_closure3) values:


Removing the guard clause made it work. So I'm guessing guard can only
handle 1 item?

Thanks

Petrik


On Wed, Jan 2, 2013 at 10:16 PM, nicolas de loof
wrote:

> use gard+rescue so you can execute a post-job even when some jobs are
> unstable
>
>
> 2013/1/2 Patrick 
>
>> Ok I'm going to have to amend this answer. My idea of having a separate
>> job at the end to gather the results would work if it wasn't for the fact
>> that the build flow plugin kills the build as soon as one of the jobs
>> fails. That means I only can get the results if the build works which is
>> not what I want. I want the results gathering to always take place, even if
>> the all the build jobs fail. Any way to achieve this?
>>
>> Thanks
>>
>> Petrik
>>
>>
>> On Wednesday, 2 January 2013 11:46:54 UTC+13, Patrick wrote:
>>>
>>> Hi
>>>
>>> Mmm ok, I guess I could create a separate job to gather all the test
>>> results. Thanks for the advice :)
>>>
>>> Regards
>>>
>>> Petrik
>>>
>>>
>>>
>>>
>


Unable to load Cobertura or Violations plugins

2013-01-02 Thread Fayaz Yusuf Khan
Hi,
I tried installing both of these plugins from the UI and the installation 
completes successfully. But I can't see them in the Installed plugins 
section. Also I found this in the logs:

Jan 3, 2013 6:37:58 AM jenkins.model.Jenkins$6 onAttained
INFO: Augmented all extensions

Jan 3, 2013 6:37:58 AM jenkins.model.Jenkins$6 onAttained
INFO: Started all plugins

Jan 3, 2013 6:37:58 AM jenkins.model.Jenkins$6 onTaskFailed
SEVERE: Failed Initializing plugin cobertura
java.lang.NullPointerException
at hudson.PluginManager$2$1$2.run(PluginManager.java:301)
at 
org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
at jenkins.model.Jenkins$5.runTask(Jenkins.java:797)
at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:679)

Jan 3, 2013 6:37:58 AM jenkins.model.Jenkins$6 onTaskFailed
SEVERE: Failed Initializing plugin violations
java.lang.NullPointerException
at hudson.PluginManager$2$1$2.run(PluginManager.java:301)
at 
org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
at jenkins.model.Jenkins$5.runTask(Jenkins.java:797)
at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:679)

Jan 3, 2013 6:37:58 AM jenkins.model.Jenkins$6 onAttained


I have a Bazaar plugin already installed and that is working fine.
So what could be a problem with these two?

Jenkins version: 1.424.6 (Debian/Ubuntu distribution)
Cobertura version: 1.8
Violations version: 0.7.11
Bazaar plugin version: 1.21



RE: migration hudson 2.2.0 to jenkins

2013-01-02 Thread Lars Nordin
Search the mailing list archives for posts from folks that have done this same 
thing.

The pattern has been – depending on how old of a version of hudson – to upgrade 
to the last version of hudson before the fork (you may need an interim upgrade 
if your version of Hudson is really old) and then upgrade to latest LTS. This 
is more effort but more likely to work and give you a working system as you 
upgrade.



Re: Disappearing build reports

2013-01-02 Thread Ryan Shoemaker
Was there an issue filed for this?  

I'm running 1.492 and noticed the disappearing build issue in a new job I 
created today (all of our existing jobs seem to behaving normally).  Builds 
of the new job do exist on disk on the Jenkins server, but they aren't 
showing in the UI.  At least not for very long.  They appear for a little 
bit and then disappear.  When they do exist, the hover-over context menu 
only shows a few of the usual options.

--Ryan

On Tuesday, 23 October 2012 09:49:32 UTC-4, Andrew Melo wrote:
>
> Hey everyone, 
>
> We're on 1.486, but we're still having our build records disappear, 
> did the planned fixes not make it into the release? 
>
> Thanks, 
> Andrew 
>
> -- 
> -- 
> Andrew Melo 
>


Re: Passing Revision numbers - quick question

2013-01-02 Thread felix schwitzer

On 01/02/2013 03:01 AM, Z W wrote:

Hi All

We have a chained job (job with 4 subjobs).
Is there a way to pass SVN revision number of the update checkout from
the 1st subjob to the next subsequent subjob among the build subjobs,
so that all the subjobs run on the latest revision number of the 1st
subjob after the 1st job started? If so, how do we do it ?

Thanks


We do this all the time using the parameterized trigger plugin, see
https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin

Regards
Felix


Re: EnvInject plugin not passing environment variable to post build action

2013-01-02 Thread glsilver...@pssd.com
This is all nice, but the envinject plugin seems to be the only way to pass 
parameters between jobs. And, apparently, post build actions, even though 
they are configured as part of one job, are considered as separate jobs and 
therefore cannot use the parameters of the original job. The envinject 
plugin is intended to provide some form of global parameterization and I 
would like to get it to work. Can anyone help solve this?

On Monday, December 31, 2012 4:22:52 PM UTC-8, glsil...@pssd.com wrote:
>
> I configured my Jenkins (v:1.492) maven job for parameterized builds and 
> to use the following evaluated groovy script:
>
> if (SERVER==null){return null;} 
> if ("qa".equals(SERVER)){ def map = [MYSERVER: "dsiqa2-fed17"] ; return 
> map }
> if ("newprod1".equals(SERVER)){ def map = [MYSERVER: "newprod1"] ; return 
> map }
> if ("newprod2".equals(SERVER)){ def map = [MYSERVER: "newprod2"] ; return 
> map }
>
>
> where "SERVER" is a choice parameter in the build that is set by the user.
>
> In a "Deploy war/ear to container" post-build action, the server URL is 
> http://$MYSERVER:8080, but $MYSERVER never gets set when I do the main 
> build, which is just a maven install from an SVN repository. is there some 
> configuration setting I need to use to get this to work? In my "Prepare 
> environment for the run" configuration, I've checked both the keep 
> environment and build variable boxes, and that is all.
>
> Here is the console stack trace. The first part shows the groovy script 
> has run:
>
> [EnvInject] - Loading node environment variables.
> [EnvInject] - Preparing an environment for the build.
> [EnvInject] - Keeping Jenkins system variables.
> [EnvInject] - Keeping Jenkins build variables.
> [EnvInject] - Adding build parameters as variables.
> [EnvInject] - Evaluation the following Groovy script content: 
> if (SERVER==null){return null;} 
> if ("qa".equals(SERVER)){ def map = [THISSERVER: "dsidev"] ; return map }
> if ("qap9".equals(SERVER)){ def map = [THISYSERVER: "dsiqa2-fed17"] ; return 
> map }
> if ("newprod1".equals(SERVER)){ def map = [THISSERVER: "newprod1"] ; return 
> map }
> if ("newprod2".equals(SERVER)){ def map = [THISSERVER: "newprod2"] ; return 
> map }
>
> [EnvInject] - Injecting contributions.
>
>
> 
>
>
> ERROR: Publisher hudson.plugins.deploy.DeployPublisher aborted due to 
> exceptionorg.codehaus.cargo.container.ContainerException 
> :
>  Failed to redeploy [/source/jenkins/jobs/ACSR.WEB Build and 
> Deploy/workspace/target/acsr.web.war]
>   at 
> org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:195)
>  
> 
>   at 
> hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:64)
>  
> 
>   at 
> hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:90)
>  
> 
>   at 
> hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:77)
>  
> 
>   at hudson.FilePath.act(FilePath.java:852) 
> 
>   at hudson.FilePath.act(FilePath.java:825) 
> 
>   at 
> hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:77)
>  
> 
>   at 
> hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:47) 
> 
>   at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36) 
> 
>   at 
> hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
>  
> 
>   at 
> hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:779)
>  
> 
>   at 
> hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModu

Jenkins does not start, or waits a long time on sshd (?)

2013-01-02 Thread Laurent Nicolas
When restarting Jenkins, I can wait a long time on "Please wait while 
Jenkins is getting ready to work", or sometimes, it just works.

When blocked, it always block at the same point, just after printing:
 

> org.apache.sshd.common.util.SecurityUtils$BouncyCastleRegistration run
> INFO: Registration succeeded


and it can stay there for a long time, waiting it seems for

org.jenkinsci.main.modules.sshd.SSHD start
INFO: Started SSHD at port 41953

It does not seem to depend on the configuration.  I could reproduce the 
issue using a fresh Jenkins installation from scratch (see below).  And I 
saw the same issue with various versions of Jenkins, including the latest 
one.
Any idea on what I may be missing?

Thank you
Laurent



Here is a trace, using a vanilla instance of Jenkins.


$ bin/jenkins_p4.sh
> Dec 20, 2012 3:29:58 PM winstone.Logger logInternal
> INFO: Beginning extraction from war file
> Dec 20, 2012 3:29:58 PM winstone.Logger logInternal
> INFO: HTTP Listener started: port=8091
> Dec 20, 2012 3:29:58 PM winstone.Logger logInternal
> INFO: AJP13 Listener started: port=8021
> Dec 20, 2012 3:29:58 PM winstone.Logger logInternal
> INFO: Winstone Servlet Engine v0.9.10 running: controlPort=disabled
> Dec 20, 2012 3:29:58 PM jenkins.InitReactorRunner$1 onAttained
> INFO: Started initialization
> Dec 20, 2012 3:29:59 PM jenkins.InitReactorRunner$1 onAttained
> INFO: Listed all plugins
> Dec 20, 2012 3:29:59 PM jenkins.InitReactorRunner$1 onAttained
> INFO: Prepared all plugins
> Dec 20, 2012 3:29:59 PM jenkins.InitReactorRunner$1 onAttained
> INFO: Started all plugins
> Dec 20, 2012 3:29:59 PM jenkins.InitReactorRunner$1 onAttained
> INFO: Augmented all extensions
> Dec 20, 2012 3:29:59 PM jenkins.InitReactorRunner$1 onAttained
> INFO: Loaded all jobs
> Dec 20, 2012 3:30:01 PM 
> org.apache.sshd.common.util.SecurityUtils$BouncyCastleRegistration run
> INFO: Trying to register BouncyCastle as a JCE provider
> Dec 20, 2012 3:30:01 PM 
> org.apache.sshd.common.util.SecurityUtils$BouncyCastleRegistration run
> INFO: Registration succeeded
>  
> <<< and it waits here, for a long time, sometimes forever >>>
>  
> Dec 20, 2012 4:23:03 PM org.jenkinsci.main.modules.sshd.SSHD start
> INFO: Started SSHD at port 41953
> Dec 20, 2012 4:23:03 PM jenkins.InitReactorRunner$1 onAttained
> INFO: Completed initialization
> Dec 20, 2012 4:23:03 PM hudson.TcpSlaveAgentListener 
> INFO: JNLP slave agent listener started on TCP port 33033
> Dec 20, 2012 4:23:03 PM hudson.WebAppMain$2 run
> INFO: Jenkins is fully up and running



Fingerprint Longevity

2013-01-02 Thread B Mann
Does anyone know if the fingerprint files are every purged?  
It seems that once a fingerprint is stored, it is never removed.  However 
we have run into some occasions where the fingerprint is missing, and I 
can't seem to nail down a reason for it.  
What, if any, are the triggers fro removal of a Jenkins Fingerprint?


Re: Build directory and clean procedure [best practices]

2013-01-02 Thread Eric Pyle

Responses inline.

-Eric

On 12/29/2012 10:50 AM, Paulo J. Matos wrote:

On 24/12/12 16:41, Eric Pyle wrote:

Hi Paulo,

I think common practice is to have your shell script build when it
detects a check-in via polling, on successful completion of build it
would call another Jenkins job to install and test.


Thanks. What do you mean 'another Jenkins job'?
Like creating a new shell script that is called by the build script?

No, I mean a separate Jenkins job, with a different name. For example, 
if you have a piece of software called "project1", you might have two 
jobs: project1_build and project1_tests. Job project1_build would check 
out and build the source code for project1, including any unit tests. 
Job project1_tests would check out system-level tests (tests that call 
the compiled software to perform certain tasks).



This separates pure
compiling errors from logical or other errors which cause tests to fail.
Second, although you can have a build directory outside the workspace, I
would not recommend it. You can set up your SCM checkout to go into a
subdirectory of the workspace if that seems better.


Is there an option to do that with git plugin in jenkins? I can't find 
anything.
I am new to git myself so I'm not an expert on this, but I think there 
is a way to do it.



On your third
question, Jenkins will not automatically delete the workspace after a
job completes. You should keep at least the most recent build's
workspace in case it is needed to diagnose issues with the build or
install/test. Jenkins can be configured as to how many past builds are
kept and whether to clean the workspace prior to starting a new build.



Thanks.


Regards,
Eric


On Mon, Dec 24, 2012 at 8:02 AM, Paulo J. Matos mailto:pa...@matos-sorge.com>> wrote:

Hello,

I am using jenkins for the first time.
Great software, I am very happy with its ease of use.

I do however have some questions:
* I got jenkins to hourly poll a git rep, the I execute a shell
script. Is this shell script supposed to build, install and test? Or
should these things be separated into different scripts?
* The workspace seems to be the git repository root; Can I have the
build directory and install directory outside the workspace?
* Should I remove the build and install directories afterwards or
will jenkins take care of that?

Is there a way to receive an email also containing the new changes
to the repository?

Thanks,

Paulo Matos




--
*Eric Pyle
*
Build Manager
CD-adapco - Lebanon, NH Office
+1 603-643-9993 x24161 (T)
+1 603-359-8670 (M)
eric.p...@cd-adapco.com

www.cd-adapco.com 

CD-adapco logo and social media buttons








Re: Possible to start/stop an existing EC2 instance

2013-01-02 Thread KEVIN FLEMING (BLOOMBERG/ 731 LEXIN)
When the EC2 plugin launches an instance from an AMI you specify, you can tell 
it to 'idle' the instance after some period of time, and you can *also* tell it 
to stop the instance instead of terminating it. If you do this, then when the 
instance is required again, it will be started back up (which is fast), run its 
jobs, then when it goes idle it will be stopped again.

This is pretty much what the OP asked for, except that the EC2 plugin itself 
will create the instance from the AMI, rather than it being manually created. 
If you never delete the created slave instance, it will stay around forever, 
but will only be running (and costing you money) when it has jobs to run or is 
in its idle period. There will be some costs for the EBS volume(s) that the 
instance uses for its filesystems, but these are quite low and would be present 
no matter how you started and stopped it.



- Original Message -
From: jenkinsci-users@googlegroups.com
To: jenkinsci-users@googlegroups.com
At: Jan  2 2013 08:43:08

   As far as I know, the EC2 instances are not support stop/start, but
   reboot.

   So you can only terminate the EC2 instances or reboot them.

   But you can terminate it and create another one on demand.

 james mintram
 December 31, 2012 3:00 AM
 Hi All,
 I wondered if it were possible, or not then a trivial update to the EC2
 plugin to allow it to start/stop an instance that already exists.
 Currently I have 2 Windows instances, 1 which is 24x7 and is covered in
 the free tier but its performance is lacking. The other is a High CPU
 instance that compiles code very fast, however I do not want this
 running 24x7 due to cost issues, so I have to manually start/stop it
 when I want to run a large set of builds.
 If there was a way to automatically start and stop an existing instance
 given its ID then it finish my CI configuration for now :)
 Regards,
     James Mintram

   --
   Adam PAPAI
   E-mail: w...@wooh.hu
   Phone: +3630 3355735
   Web: http://www.wooh.hu

<>

Re: Possible to start/stop an existing EC2 instance

2013-01-02 Thread Adam PAPAI
As far as I know, the EC2 
instances are not support stop/start, but reboot.

So you can only terminate the EC2 instances or reboot them.

But you can terminate it and create another one on demand.


   	   
   	james mintram  
  December 31, 2012
 3:00 AM
  Hi All,I 
wondered if it were possible, or not then a trivial update to the EC2 
plugin to allow it to start/stop an instance that already exists.Currently
 I have 2 Windows instances, 1 which is 24x7 and is covered in the free 
tier but its performance is lacking. The other is a High CPU instance 
that compiles code very fast, however I do not want this running 24x7 
due to cost issues, so I have to manually start/stop it when I want to 
run a large set of builds.If there was a 
way to automatically start and stop an existing instance given its ID 
then it finish my CI configuration for now :)Regards, 
   James Mintram
  


-- Adam PAPAI

E-mail: w...@wooh.hu
Phone: +3630 3355735

Web: http://www.wooh.hu






Re: Build flow plugin: How to copy results from downstream jobs

2013-01-02 Thread nicolas de loof
use gard+rescue so you can execute a post-job even when some jobs are
unstable

2013/1/2 Patrick 

> Ok I'm going to have to amend this answer. My idea of having a separate
> job at the end to gather the results would work if it wasn't for the fact
> that the build flow plugin kills the build as soon as one of the jobs
> fails. That means I only can get the results if the build works which is
> not what I want. I want the results gathering to always take place, even if
> the all the build jobs fail. Any way to achieve this?
>
> Thanks
>
> Petrik
>
>
> On Wednesday, 2 January 2013 11:46:54 UTC+13, Patrick wrote:
>>
>> Hi
>>
>> Mmm ok, I guess I could create a separate job to gather all the test
>> results. Thanks for the advice :)
>>
>> Regards
>>
>> Petrik
>>
>>
>>
>>


Need help for dropdownDescriptorSelector

2013-01-02 Thread Adil Shabbir
Hi! All,

Wish you all a very Happy new Year-2013

Can any one point out the sample code(jelly and java) how to use
'dropdownDescriptorSelector' in Jenkins plugin.

Adil


Re: Build flow plugin: How to copy results from downstream jobs

2013-01-02 Thread nicolas de loof
Guard + rescue
Le 2 janv. 2013 02:11, "Patrick"  a écrit :

> Ok I'm going to have to amend this answer. My idea of having a separate
> job at the end to gather the results would work if it wasn't for the fact
> that the build flow plugin kills the build as soon as one of the jobs
> fails. That means I only can get the results if the build works which is
> not what I want. I want the results gathering to always take place, even if
> the all the build jobs fail. Any way to achieve this?
>
> Thanks
>
> Petrik
>
> On Wednesday, 2 January 2013 11:46:54 UTC+13, Patrick wrote:
>>
>> Hi
>>
>> Mmm ok, I guess I could create a separate job to gather all the test
>> results. Thanks for the advice :)
>>
>> Regards
>>
>> Petrik
>>
>>
>>
>>