Conditional build steps for maven projects

2014-02-18 Thread srivastv
Hi,

How can I run conditional steps with Maven projects ? For free style
projects I am able to set up conditional steps but this seems not available
with Maven projects.

Additionally I also want to publish findbugs/pmd reports conditionally in
maven projects. Again this looks possible using flexible publish plugin only
for free style projects.

Any help would be highly appreciated.

-Thanks



--
View this message in context: 
http://jenkins-ci.361315.n4.nabble.com/Conditional-build-steps-for-maven-projects-tp4690508.html
Sent from the Jenkins users mailing list archive at Nabble.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Conditional build steps for maven projects

2014-02-17 Thread Maciej Jaros

varun srivastava (2014-02-17 08:13):

Hi,

How can I run conditional steps with Maven projects ? For free style 
projects I am able to set up conditional steps but this seems not 
available with Maven projects.


Conditional steps are available both after and before Maven is build is 
run (in Pre/Post steps). I'm not sure what is missing? I'm assuming you 
have Conditional BuildStep Plugin?


Note that you can also add "Conditional steps (multiple)" and inside 
that add e.g. call to a different job (with Parameterized Trigger Plugin).


Additionally I also want to publish findbugs/pmd reports conditionally 
in maven projects. Again this looks possible using flexible publish 
plugin only for free style projects.


You can run Findbugs and other tests within Sonar and you can have a 
step "Invoke Standalone Sonar Analysis" within "Conditional steps 
(multiple)". Haven't tried that myself (we have a separate job for full 
tests), but that seems possible.


Cheers,
Nux.

--
You received this message because you are subscribed to the Google Groups "Jenkins 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Conditional build steps for maven projects

2014-02-17 Thread Stephen Connolly
Ah but the advantage is you have a reproducible build... Unlike a build
with the evil job type

On Monday, 17 February 2014, varun srivastava 
wrote:

> Thanks for the reply.
>
> I have tried this. But the disadvantage is that I loose features related
> to maven projects like Displaying modules built, modules history etc. (For
> multi-module maven projects)
>
>
> On Tue, Feb 18, 2014 at 1:07 AM, Eric Pyle 
> 
> > wrote:
>
>>  You can run a Maven build in a freestyle job. Add a build step of type
>> "Invoke top-level Maven targets". Then you can use conditional build steps
>> and all other features of freestyle builds.
>>
>> Regards,
>> Eric
>>
>>
>> On 2/17/2014 2:13 AM, varun srivastava wrote:
>>
>> Hi,
>>
>> How can I run conditional steps with Maven projects ? For free style
>> projects I am able to set up conditional steps but this seems not available
>> with Maven projects.
>>
>> Additionally I also want to publish findbugs/pmd reports conditionally in
>> maven projects. Again this looks possible using flexible publish plugin
>> only for free style projects.
>>
>> Any help would be highly appreciated.
>>
>> -Thanks
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to 
>> jenkinsci-users+unsubscr...@googlegroups.com
>> .
>>
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>  --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Jenkins Users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/jenkinsci-users/7evg1xPffd8/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> jenkinsci-users+unsubscr...@googlegroups.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> --
> Thanks,
>
> Varun Kr Srivastava
> mobile- +91976033
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to 
> jenkinsci-users+unsubscr...@googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>


-- 
Sent from my phone

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Conditional build steps for maven projects

2014-02-17 Thread varun srivastava
Thanks for the reply.

I have tried this. But the disadvantage is that I loose features related to
maven projects like Displaying modules built, modules history etc. (For
multi-module maven projects)


On Tue, Feb 18, 2014 at 1:07 AM, Eric Pyle  wrote:

>  You can run a Maven build in a freestyle job. Add a build step of type
> "Invoke top-level Maven targets". Then you can use conditional build steps
> and all other features of freestyle builds.
>
> Regards,
> Eric
>
>
> On 2/17/2014 2:13 AM, varun srivastava wrote:
>
> Hi,
>
> How can I run conditional steps with Maven projects ? For free style
> projects I am able to set up conditional steps but this seems not available
> with Maven projects.
>
> Additionally I also want to publish findbugs/pmd reports conditionally in
> maven projects. Again this looks possible using flexible publish plugin
> only for free style projects.
>
> Any help would be highly appreciated.
>
> -Thanks
>  --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
>
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/jenkinsci-users/7evg1xPffd8/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> jenkinsci-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Thanks,

Varun Kr Srivastava
mobile- +91976033

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Conditional build steps for maven projects

2014-02-17 Thread Eric Pyle
You can run a Maven build in a freestyle job. Add a build step of type 
"Invoke top-level Maven targets". Then you can use conditional build 
steps and all other features of freestyle builds.


Regards,
Eric

On 2/17/2014 2:13 AM, varun srivastava wrote:

Hi,

How can I run conditional steps with Maven projects ? For free style 
projects I am able to set up conditional steps but this seems not 
available with Maven projects.


Additionally I also want to publish findbugs/pmd reports conditionally 
in maven projects. Again this looks possible using flexible publish 
plugin only for free style projects.


Any help would be highly appreciated.

-Thanks
--
You received this message because you are subscribed to the Google 
Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to jenkinsci-users+unsubscr...@googlegroups.com.

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


--
You received this message because you are subscribed to the Google Groups "Jenkins 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Conditional build steps for maven projects

2014-02-16 Thread varun srivastava
Hi, 

How can I run conditional steps with Maven projects ? For free style 
projects I am able to set up conditional steps but this seems not available 
with Maven projects. 

Additionally I also want to publish findbugs/pmd reports conditionally in 
maven projects. Again this looks possible using flexible publish plugin 
only for free style projects. 

Any help would be highly appreciated. 

-Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Conditional Build Steps

2012-07-16 Thread Josh D
Guess I'm not sure what side of the boat the hole was in.  I fiddled with 
it a couple hours before finding a new solution.  The way I set it up was 
to first attempt a parameterized artifact copy as an optional step.  
Following that, I used the conditional build step plugin to check if the 
expected artifacts were copied and if not, kick off a parameterized build, 
wait, and then recopy.  Seems to be working well so far.

On Monday, July 16, 2012 3:18:06 PM UTC-6, Jan Seidel wrote:
>
> You are right,
>
> the condition is met but your copy artifact plugin fails. The conditional 
> build step works perfect.
> I have seen this bug several time. In my occassion was the copier set to 
> copy artifacts from the job that triggered that particular build instead of 
> last successful build.
> You should focus you on the artifact copier.
>
> Take care
> Jan
>
> Am Freitag, 13. Juli 2012 19:44:28 UTC+2 schrieb Josh D:
>>
>> Unfortunately those wouldn't work.  Simply rescheduling the build 
>> wouldn't correct the problem that the external dependency doesn't exist.  
>> Now yes, someone could detect the failure and manually execute a build on 
>> the dependency to rectify the problem before the rescheduled build takes 
>> place, but that doesn't rectify the problem.
>>
>> I've been trying to get the following plugin to work: 
>> https://wiki.jenkins-ci.org/display/JENKINS/Conditional+BuildStep+Plugin
>>
>> However, I cannot seem to get the conditional build step to run after a 
>> failed step.  For example, I defined a sequence:
>>
>> 1. copy artifacts->sim-common-linux64/SIM_COMMON_REV=${SIM_COMMON_REV}
>> 2. conditional build step: Run? Current build status (worst: aborted 
>> best: unstable)
>> Steps to run if condition is built:
>> 2a. Trigger/call builds on other projects: sim-common-linux64
>> 2b. copy artifacts->sim-common-linux64/SIM_COMMON_REV=${SIM_COMMON_REV}
>>
>> However, the conditional steps are never executed.  See the following 
>> output:
>>
>> Started by user davidsj2 
>> [EnvInject] - Loading node environment variables.
>> Building remotely on AST-Linux-x64-scts01 
>>  in 
>> workspace /disk01/BUILD/workspace/sast_product_linux64
>> [sast_product] $ hg showconfig paths.default
>> [sast_product] $ hg pull --rev default
>> [sast_product] $ hg update --clean --rev default
>> 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
>> [sast_product] $ hg log --rev . --template {node}
>> [sast_product] $ hg log --rev . --template {rev}
>> [sast_product] $ hg log --rev 8f947e56c1a6693687e8097fb50bba1626989ea6
>> [sast_product] $ hg log --template "> author='{author|xmlescape}' rev='{rev}' 
>> date='{date}'>{desc|xmlescape}{file_adds|stringify|xmlescape}{file_dels|stringify|xmlescape}{files|stringify|xmlescape}{parents}\n"
>>  --rev default:0 --follow --prune 8f947e56c1a6693687e8097fb50bba1626989ea6
>> Run condition [Current build status] enabling prebuild for step 
>> [BuilderChain]
>> Unable to find a build for artifact copy from: 
>> sim-common-linux64/SIM_COMMON_REV=zomg
>> Build step 'Copy artifacts from another project' marked build as failure
>> Archiving artifacts
>> Recording fingerprints
>> Notifying upstream projects of job completion
>> Finished: FAILURE
>>
>> You can see that the run condition seems to be enabled.  Then the intital 
>> copy fails, but the conditional build step never runs.
>>
>>
>>
>>
>>
>> On Tuesday, July 3, 2012 1:36:26 AM UTC-6, Jan Seidel wrote:
>>>
>>> Hi Josh,
>>>
>>> what about https://wiki.jenkins-ci.org/display/JENKINS/Naginator+Pluginor 
>>> https://wiki.jenkins-ci.org/display/JENKINS/Retry+Failed+Builds+Plugin ?
>>>
>>> Am Freitag, 29. Juni 2012 21:49:44 UTC+2 schrieb Josh D:

 I have a parameterized job that has a number of dependencies that it 
 copies in using parametrized copy artifacts build steps, e.g.: copy: 
 sim-common-linux64/SIM_COMMON_REV=${SIM_COMMON_REV}.

 If there isn't a build of sim-common-linux64 that matches the 
 SIM_COMMON_REV, that step fails, as you would expect.  What I'd like to do 
 is something like:

 Execute copy 
 artifacts->sim-common-linux64/SIM_COMMON_REV=${SIM_COMMON_REV}

 If copy fails:
 1. Trigger parameterized build on sim-common-linux64
 2. Re-execute copy artifacts

 I know I could get similar behavior by just issuing the parameterized 
 build and then copying, but people here don't want to kick off jobs that 
 aren't required.



Re: Conditional Build Steps

2012-07-16 Thread Jan Seidel
You are right,

the condition is met but your copy artifact plugin fails. The conditional 
build step works perfect.
I have seen this bug several time. In my occassion was the copier set to 
copy artifacts from the job that triggered that particular build instead of 
last successful build.
You should focus you on the artifact copier.

Take care
Jan

Am Freitag, 13. Juli 2012 19:44:28 UTC+2 schrieb Josh D:
>
> Unfortunately those wouldn't work.  Simply rescheduling the build wouldn't 
> correct the problem that the external dependency doesn't exist.  Now yes, 
> someone could detect the failure and manually execute a build on the 
> dependency to rectify the problem before the rescheduled build takes place, 
> but that doesn't rectify the problem.
>
> I've been trying to get the following plugin to work: 
> https://wiki.jenkins-ci.org/display/JENKINS/Conditional+BuildStep+Plugin
>
> However, I cannot seem to get the conditional build step to run after a 
> failed step.  For example, I defined a sequence:
>
> 1. copy artifacts->sim-common-linux64/SIM_COMMON_REV=${SIM_COMMON_REV}
> 2. conditional build step: Run? Current build status (worst: aborted best: 
> unstable)
> Steps to run if condition is built:
> 2a. Trigger/call builds on other projects: sim-common-linux64
> 2b. copy artifacts->sim-common-linux64/SIM_COMMON_REV=${SIM_COMMON_REV}
>
> However, the conditional steps are never executed.  See the following 
> output:
>
> Started by user davidsj2 
> [EnvInject] - Loading node environment variables.
> Building remotely on AST-Linux-x64-scts01 
>  in workspace 
> /disk01/BUILD/workspace/sast_product_linux64
> [sast_product] $ hg showconfig paths.default
> [sast_product] $ hg pull --rev default
> [sast_product] $ hg update --clean --rev default
> 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
> [sast_product] $ hg log --rev . --template {node}
> [sast_product] $ hg log --rev . --template {rev}
> [sast_product] $ hg log --rev 8f947e56c1a6693687e8097fb50bba1626989ea6
> [sast_product] $ hg log --template " author='{author|xmlescape}' rev='{rev}' 
> date='{date}'>{desc|xmlescape}{file_adds|stringify|xmlescape}{file_dels|stringify|xmlescape}{files|stringify|xmlescape}{parents}\n"
>  --rev default:0 --follow --prune 8f947e56c1a6693687e8097fb50bba1626989ea6
> Run condition [Current build status] enabling prebuild for step [BuilderChain]
> Unable to find a build for artifact copy from: 
> sim-common-linux64/SIM_COMMON_REV=zomg
> Build step 'Copy artifacts from another project' marked build as failure
> Archiving artifacts
> Recording fingerprints
> Notifying upstream projects of job completion
> Finished: FAILURE
>
> You can see that the run condition seems to be enabled.  Then the intital 
> copy fails, but the conditional build step never runs.
>
>
>
>
>
> On Tuesday, July 3, 2012 1:36:26 AM UTC-6, Jan Seidel wrote:
>>
>> Hi Josh,
>>
>> what about https://wiki.jenkins-ci.org/display/JENKINS/Naginator+Pluginor 
>> https://wiki.jenkins-ci.org/display/JENKINS/Retry+Failed+Builds+Plugin ?
>>
>> Am Freitag, 29. Juni 2012 21:49:44 UTC+2 schrieb Josh D:
>>>
>>> I have a parameterized job that has a number of dependencies that it 
>>> copies in using parametrized copy artifacts build steps, e.g.: copy: 
>>> sim-common-linux64/SIM_COMMON_REV=${SIM_COMMON_REV}.
>>>
>>> If there isn't a build of sim-common-linux64 that matches the 
>>> SIM_COMMON_REV, that step fails, as you would expect.  What I'd like to do 
>>> is something like:
>>>
>>> Execute copy 
>>> artifacts->sim-common-linux64/SIM_COMMON_REV=${SIM_COMMON_REV}
>>>
>>> If copy fails:
>>> 1. Trigger parameterized build on sim-common-linux64
>>> 2. Re-execute copy artifacts
>>>
>>> I know I could get similar behavior by just issuing the parameterized 
>>> build and then copying, but people here don't want to kick off jobs that 
>>> aren't required.
>>>
>>>

Re: Conditional Build Steps

2012-07-13 Thread Josh D
Unfortunately those wouldn't work.  Simply rescheduling the build wouldn't 
correct the problem that the external dependency doesn't exist.  Now yes, 
someone could detect the failure and manually execute a build on the 
dependency to rectify the problem before the rescheduled build takes place, 
but that doesn't rectify the problem.

I've been trying to get the following plugin to work: 
https://wiki.jenkins-ci.org/display/JENKINS/Conditional+BuildStep+Plugin

However, I cannot seem to get the conditional build step to run after a 
failed step.  For example, I defined a sequence:

1. copy artifacts->sim-common-linux64/SIM_COMMON_REV=${SIM_COMMON_REV}
2. conditional build step: Run? Current build status (worst: aborted best: 
unstable)
Steps to run if condition is built:
2a. Trigger/call builds on other projects: sim-common-linux64
2b. copy artifacts->sim-common-linux64/SIM_COMMON_REV=${SIM_COMMON_REV}

However, the conditional steps are never executed.  See the following 
output:

Started by user davidsj2 
[EnvInject] - Loading node environment variables.
Building remotely on AST-Linux-x64-scts01 
 in workspace 
/disk01/BUILD/workspace/sast_product_linux64
[sast_product] $ hg showconfig paths.default
[sast_product] $ hg pull --rev default
[sast_product] $ hg update --clean --rev default
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
[sast_product] $ hg log --rev . --template {node}
[sast_product] $ hg log --rev . --template {rev}
[sast_product] $ hg log --rev 8f947e56c1a6693687e8097fb50bba1626989ea6
[sast_product] $ hg log --template "{desc|xmlescape}{file_adds|stringify|xmlescape}{file_dels|stringify|xmlescape}{files|stringify|xmlescape}{parents}\n"
 --rev default:0 --follow --prune 8f947e56c1a6693687e8097fb50bba1626989ea6
Run condition [Current build status] enabling prebuild for step [BuilderChain]
Unable to find a build for artifact copy from: 
sim-common-linux64/SIM_COMMON_REV=zomg
Build step 'Copy artifacts from another project' marked build as failure
Archiving artifacts
Recording fingerprints
Notifying upstream projects of job completion
Finished: FAILURE

You can see that the run condition seems to be enabled.  Then the intital copy 
fails, but the conditional build step never runs.





On Tuesday, July 3, 2012 1:36:26 AM UTC-6, Jan Seidel wrote:
>
> Hi Josh,
>
> what about https://wiki.jenkins-ci.org/display/JENKINS/Naginator+Pluginor 
> https://wiki.jenkins-ci.org/display/JENKINS/Retry+Failed+Builds+Plugin ?
>
> Am Freitag, 29. Juni 2012 21:49:44 UTC+2 schrieb Josh D:
>>
>> I have a parameterized job that has a number of dependencies that it 
>> copies in using parametrized copy artifacts build steps, e.g.: copy: 
>> sim-common-linux64/SIM_COMMON_REV=${SIM_COMMON_REV}.
>>
>> If there isn't a build of sim-common-linux64 that matches the 
>> SIM_COMMON_REV, that step fails, as you would expect.  What I'd like to do 
>> is something like:
>>
>> Execute copy 
>> artifacts->sim-common-linux64/SIM_COMMON_REV=${SIM_COMMON_REV}
>>
>> If copy fails:
>> 1. Trigger parameterized build on sim-common-linux64
>> 2. Re-execute copy artifacts
>>
>> I know I could get similar behavior by just issuing the parameterized 
>> build and then copying, but people here don't want to kick off jobs that 
>> aren't required.
>>
>>

Re: Conditional Build Steps

2012-07-03 Thread Jan Seidel
Hi Josh,

what about https://wiki.jenkins-ci.org/display/JENKINS/Naginator+Plugin or 
https://wiki.jenkins-ci.org/display/JENKINS/Retry+Failed+Builds+Plugin ?

Am Freitag, 29. Juni 2012 21:49:44 UTC+2 schrieb Josh D:
>
> I have a parameterized job that has a number of dependencies that it 
> copies in using parametrized copy artifacts build steps, e.g.: copy: 
> sim-common-linux64/SIM_COMMON_REV=${SIM_COMMON_REV}.
>
> If there isn't a build of sim-common-linux64 that matches the 
> SIM_COMMON_REV, that step fails, as you would expect.  What I'd like to do 
> is something like:
>
> Execute copy artifacts->sim-common-linux64/SIM_COMMON_REV=${SIM_COMMON_REV}
>
> If copy fails:
> 1. Trigger parameterized build on sim-common-linux64
> 2. Re-execute copy artifacts
>
> I know I could get similar behavior by just issuing the parameterized 
> build and then copying, but people here don't want to kick off jobs that 
> aren't required.
>
>

Conditional Build Steps

2012-06-29 Thread Josh D
I have a parameterized job that has a number of dependencies that it copies 
in using parametrized copy artifacts build steps, e.g.: copy: 
sim-common-linux64/SIM_COMMON_REV=${SIM_COMMON_REV}.

If there isn't a build of sim-common-linux64 that matches the 
SIM_COMMON_REV, that step fails, as you would expect.  What I'd like to do 
is something like:

Execute copy artifacts->sim-common-linux64/SIM_COMMON_REV=${SIM_COMMON_REV}

If copy fails:
1. Trigger parameterized build on sim-common-linux64
2. Re-execute copy artifacts

I know I could get similar behavior by just issuing the parameterized build 
and then copying, but people here don't want to kick off jobs that aren't 
required.