Re: How to access value of a parameter using remote api

2012-10-31 Thread lvotypko
Yes it is possible

you can find it on path /job/name of job/config.xml

the part of xml with this value shoud have this form

hudson.model.StringParameterDefinition
  name
name
  /name
  description/
  defaultValue 
dafulat_value
  /defaultValue
/hudson.model.StringParameterDefinition


Script behaves differently when run through Jenkins

2012-10-31 Thread Burkhard Reffeling
Hi all,

I've got a Jenkins build that runs a Capistrano deploy as a post-build 
action.
 
Running the Capistrano task as the Jenkins user from the console works 
absolutely fine and without a password prompt (I've previously set up SSH 
keys on both build and staging server). However, when running the same 
script through Jenkins, I suddenly get a password prompt and the build 
subsequently fails (no TTY present).

[workspace] $ /bin/sh -xe /tmp/hudson7321493219694918714.sh
 Performing Post build task...
 Match found for : : True
 Logical operation result is TRUE
 Running script  : cap _2.13.4_ deploy
 [workspace] $ /bin/sh -xe /tmp/hudson1545664641721322948.sh
 + cap _2.13.4_ deploy
   * executing `deploy'
   * executing `deploy:update'
  ** transaction: start
   * executing `deploy:update_code'
 triggering before callbacks for `deploy:update_code'
 [32m-- Updating code base with checkout strategy[0m
 executing locally: git ls-remote 
 g...@my.staging-server.com:my_project.git master
 command finished in 1200ms
   * executing git clone -q g...@my.staging-server.com:my_project.git 
 /var/www/staging/my_project/releases/20121029223619  cd 
 /var/www/staging/my_project/releases/20121029223619  git checkout -q -b 
 deploy 1fb11d669a6cb5a714d077162305dfcfaba82f01  (echo 
 1fb11d669a6cb5a714d077162305dfcfaba82f01  
 /var/www/staging/my_project/releases/20121029223619/REVISION)
 servers: [my.staging-server.com]
 Password: stty: standard input: Inappropriate ioctl for device
 stty: standard input: Inappropriate ioctl for device
 stty: standard input: Inappropriate ioctl for device
 
 *** [deploy:update_code] rolling back
   * executing rm -rf 
 /var/www/staging/my_project/releases/20121029223619; true
 servers: [my.staging-server.com]
  ** [deploy:update_code] exception while rolling back: 
 Capistrano::ConnectionError, connection failed for: my.staging-server.com 
 (Net::SSH::AuthenticationFailed: not-specified)
 connection failed for: my.staging-server.com 
 (Net::SSH::AuthenticationFailed: not-specified)
 POST BUILD TASK : FAILURE



It looks like Ruby doesn't pick my SSH key up when running through Jenkins 
perhaps (`Net::SSH::AuthenticationFailed: not-specified`)?


Does anyone have an idea what might be going wrong here?


Headless GUI testing on Windows

2012-10-31 Thread Jeff MAURY
I'm using Jenkins to build an Eclipse based product and I have SWTBot based 
tests that performs validation of the UI layer.
As Jenkins is running on a Ubuntu server (headless), I was able to run the 
UI tests on Linux thanks to the Xvfb Jenkins plugin.
But as main target platform is Windows, I am thinking about running the UI 
tests on that platform (on the same machine inside a VM)
As Jenkins will be running as a service on Windows, it is not possible to 
run UI tests for Windows.
Do you a kind of Xvfb equivalent for Windows ?
Or maybe if I run my virtual machine together with Xvfb and allowing 
Jenkins service to interact with the desktop, do you think that might work ?

Thanks
Jeff




Re: Re: LTS 1.480.1 RC1 testing

2012-10-31 Thread Vojtech Juranek

 Should I post this to the jenkins blog?

as you want. If you do so, you can stress that we would appreciate some 
Windows testes as our test coverage on windows is exactly 0% right now


Re: Re: LTS 1.480.1 RC1 testing

2012-10-31 Thread Vojtech Juranek
Hi Mark,

 I've logged several of the tests I performed on various configurations and
 added an additional section exploratory tests.  I wanted a place to
 record creative tests I've never tried before.  Those types of tests
 aren't as helpful for detecting regressions, but may discover bugs more
 quickly (for me anyway) because I suffer less from inattentional blindness
 when running exploratory tests.  You're welcome to delete the exploratory
 tests section if you find it too distracting.

thanks! I like it and find it useful, i.e. I'm definitely not going to delete 
it.
Btw: some kind of performance and SOAK tests is a field I'd like to draw the 
attention once we have reasonable test coverage of Selenium tests. So I really 
appreciate such tests

Vojta


Re: Headless GUI testing on Windows

2012-10-31 Thread Fred G
Hi,

after having multiple problems with the interaction of the Jenkins service 
and the Windows desktop, the best solution
I found was the JNLP web start client which is called from a shortcut in 
the Autostart folder.

Hope that helps.

Regards,

Fred

On Wednesday, October 31, 2012 11:26:35 AM UTC+1, Jeff MAURY wrote:

 I'm using Jenkins to build an Eclipse based product and I have SWTBot 
 based tests that performs validation of the UI layer.
 As Jenkins is running on a Ubuntu server (headless), I was able to run the 
 UI tests on Linux thanks to the Xvfb Jenkins plugin.
 But as main target platform is Windows, I am thinking about running the UI 
 tests on that platform (on the same machine inside a VM)
 As Jenkins will be running as a service on Windows, it is not possible to 
 run UI tests for Windows.
 Do you a kind of Xvfb equivalent for Windows ?
 Or maybe if I run my virtual machine together with Xvfb and allowing 
 Jenkins service to interact with the desktop, do you think that might work ?

 Thanks
 Jeff




Re: Headless GUI testing on Windows

2012-10-31 Thread Jason Swager
See 
http://stackoverflow.com/questions/10177708/jenkins-on-windows-and-gui-tests-without-rdc

On Wednesday, October 31, 2012 3:26:35 AM UTC-7, Jeff MAURY wrote:

 I'm using Jenkins to build an Eclipse based product and I have SWTBot 
 based tests that performs validation of the UI layer.
 As Jenkins is running on a Ubuntu server (headless), I was able to run the 
 UI tests on Linux thanks to the Xvfb Jenkins plugin.
 But as main target platform is Windows, I am thinking about running the UI 
 tests on that platform (on the same machine inside a VM)
 As Jenkins will be running as a service on Windows, it is not possible to 
 run UI tests for Windows.
 Do you a kind of Xvfb equivalent for Windows ?
 Or maybe if I run my virtual machine together with Xvfb and allowing 
 Jenkins service to interact with the desktop, do you think that might work ?

 Thanks
 Jeff




Using the changeset of the ClearCase UCM plugin

2012-10-31 Thread marcdb
Hello, 

I am trying to set up a Jenkins project with the ClearCase UCM plugin. Our 
build system is based on oobs and ivy and we use the dependencies defined 
in ivy to determine what needs to be built. I wanted to use the changeset 
generated during a build job for further processing inside that job. So my 
first question is whether it is possible to access this changeset ? I found 
some groovy code on stackoverflow (http://stackoverflow.com/a/6261180) 
illustrating this concept for other SCM-systems, but I don't know if this 
can also be used for the ClearCase UCM plugin.

I also wanted to know what is included in the changeset produced by the 
plugin. What I actually want, is a changeset consisting of the difference 
between:

   - the most recent INITIAL baseline on a stream and
   - the most recent BUILT baseline.

I will be using the stream in self-polling mode. Then I want to rebuild all 
modules (our modules are sub-directories of our UCM components) and their 
dependees that have been changed since the last BUILT baseline. If the 
build would fail, the baseline would not be promoted to BUILT and the next 
run should rebuild also all changed modules from that run.

Actually it is more complicated then I thought when I started writing this: 
if nothing would have been changed between two INITIAL baselines, then it 
doesn't make sense to start a new build anyway. So I realise now I need two 
changesets: one to trigger a new build (based on the difference between the 
previous INITIAL baseline) and a changeset based on the difference between 
the latest INITIAL and the latest BUILT baseline.

Has anybody else done something similar ? Can the current ClearCase UCM 
plugin be used for this ?

Thanks,
Marc


Re: Script behaves differently when run through Jenkins

2012-10-31 Thread Vincent Latombe
Hi,

you should check that the HOME variable is defined and accessible to the
Jenkins process (or to the slave that is executing the task). I remember
having the same kind of issue running git clients.

Hope that helps,

Vincent


2012/10/31 Burkhard Reffeling burkhard.reffel...@gmail.com

 Hi all,

 I've got a Jenkins build that runs a Capistrano deploy as a post-build
 action.

 Running the Capistrano task as the Jenkins user from the console works
 absolutely fine and without a password prompt (I've previously set up SSH
 keys on both build and staging server). However, when running the same
 script through Jenkins, I suddenly get a password prompt and the build
 subsequently fails (no TTY present).

 [workspace] $ /bin/sh -xe /tmp/hudson7321493219694918714.sh
 Performing Post build task...
 Match found for : : True
 Logical operation result is TRUE
 Running script  : cap _2.13.4_ deploy
 [workspace] $ /bin/sh -xe /tmp/hudson1545664641721322948.sh
 + cap _2.13.4_ deploy
   * executing `deploy'
   * executing `deploy:update'
  ** transaction: start
   * executing `deploy:update_code'
 triggering before callbacks for `deploy:update_code'
 [32m-- Updating code base with checkout strategy[0m
 executing locally: git ls-remote 
 g...@my.staging-server.com:my_project.git
 master
 command finished in 1200ms
   * executing git clone -q g...@my.staging-server.com:my_project.git
 /var/www/staging/my_project/releases/20121029223619  cd
 /var/www/staging/my_project/releases/20121029223619  git checkout -q -b
 deploy 1fb11d669a6cb5a714d077162305dfcfaba82f01  (echo
 1fb11d669a6cb5a714d077162305dfcfaba82f01 
 /var/www/staging/my_project/releases/20121029223619/REVISION)
 servers: [my.staging-server.com]
 Password: stty: standard input: Inappropriate ioctl for device
 stty: standard input: Inappropriate ioctl for device
 stty: standard input: Inappropriate ioctl for device

 *** [deploy:update_code] rolling back
   * executing rm -rf
 /var/www/staging/my_project/releases/20121029223619; true
 servers: [my.staging-server.com]
  ** [deploy:update_code] exception while rolling back:
 Capistrano::ConnectionError, connection failed for: 
 my.staging-server.com(Net::SSH::AuthenticationFailed: not-specified)
 connection failed for: 
 my.staging-server.com(Net::SSH::AuthenticationFailed: not-specified)
 POST BUILD TASK : FAILURE



 It looks like Ruby doesn't pick my SSH key up when running through Jenkins
 perhaps (`Net::SSH::AuthenticationFailed: not-specified`)?


 Does anyone have an idea what might be going wrong here?



Re: Script behaves differently when run through Jenkins

2012-10-31 Thread Burkhard Reffeling
So I added the following line to the top of my script:
  cd $HOME/.ssh  ls -al  cat id_rsa.pub

Looks fine to me:


[workspace] $ /bin/sh -xe /tmp/hudson7533718270802434100.sh
+ cd /var/lib/jenkins/.ssh
+ ls -al
total 24
drwx-- 2 jenkins jenkins 4096 Oct 30 23:48 .
drwxr-xr-x 9 jenkins jenkins 4096 Oct 31 17:34 ..
-rw-rw-r-- 1 jenkins jenkins   43 Oct 30 23:48 config
-rw--- 1 jenkins jenkins 1675 Oct 27 14:09 id_rsa
-rw-r--r-- 1 jenkins jenkins  410 Oct 27 14:09 id_rsa.pub
-rwx-- 1 jenkins jenkins 1306 Oct 28 22:20 known_hosts
+ cat id_rsa.pub
[MY PUBLIC KEY ...]


*
*
*Burkhard Reffeling*

Software Engineer



On 31 October 2012 17:02, Vincent Latombe vincent.lato...@gmail.com wrote:

 Hi,

 you should check that the HOME variable is defined and accessible to the
 Jenkins process (or to the slave that is executing the task). I remember
 having the same kind of issue running git clients.

 Hope that helps,

 Vincent



 2012/10/31 Burkhard Reffeling burkhard.reffel...@gmail.com

 Hi all,

 I've got a Jenkins build that runs a Capistrano deploy as a post-build
 action.

 Running the Capistrano task as the Jenkins user from the console works
 absolutely fine and without a password prompt (I've previously set up SSH
 keys on both build and staging server). However, when running the same
 script through Jenkins, I suddenly get a password prompt and the build
 subsequently fails (no TTY present).

 [workspace] $ /bin/sh -xe /tmp/hudson7321493219694918714.sh
 Performing Post build task...
 Match found for : : True
 Logical operation result is TRUE
 Running script  : cap _2.13.4_ deploy
 [workspace] $ /bin/sh -xe /tmp/hudson1545664641721322948.sh
 + cap _2.13.4_ deploy
   * executing `deploy'
   * executing `deploy:update'
  ** transaction: start
   * executing `deploy:update_code'
 triggering before callbacks for `deploy:update_code'
 [32m-- Updating code base with checkout strategy[0m
 executing locally: git ls-remote 
 g...@my.staging-server.com:my_project.git
 master
 command finished in 1200ms
   * executing git clone -q g...@my.staging-server.com:my_project.git
 /var/www/staging/my_project/releases/20121029223619  cd
 /var/www/staging/my_project/releases/20121029223619  git checkout -q -b
 deploy 1fb11d669a6cb5a714d077162305dfcfaba82f01  (echo
 1fb11d669a6cb5a714d077162305dfcfaba82f01 
 /var/www/staging/my_project/releases/20121029223619/REVISION)
 servers: [my.staging-server.com]
 Password: stty: standard input: Inappropriate ioctl for device
 stty: standard input: Inappropriate ioctl for device
 stty: standard input: Inappropriate ioctl for device

 *** [deploy:update_code] rolling back
   * executing rm -rf
 /var/www/staging/my_project/releases/20121029223619; true
 servers: [my.staging-server.com]
  ** [deploy:update_code] exception while rolling back:
 Capistrano::ConnectionError, connection failed for:
 my.staging-server.com (Net::SSH::AuthenticationFailed: not-specified)
 connection failed for: 
 my.staging-server.com(Net::SSH::AuthenticationFailed: not-specified)
 POST BUILD TASK : FAILURE



 It looks like Ruby doesn't pick my SSH key up when running through
 Jenkins perhaps (`Net::SSH::AuthenticationFailed: not-specified`)?


 Does anyone have an idea what might be going wrong here?





Re: Script behaves differently when run through Jenkins

2012-10-31 Thread Stephen Connolly
You might want to try out the ssh agent plugin... Though it is a tad rough
and ready. It will work if you install tomcat-native on all the build nodes
that need the agent

On Wednesday, 31 October 2012, Burkhard Reffeling wrote:

 So I added the following line to the top of my script:
   cd $HOME/.ssh  ls -al  cat id_rsa.pub

 Looks fine to me:


 [workspace] $ /bin/sh -xe /tmp/hudson7533718270802434100.sh
 + cd /var/lib/jenkins/.ssh
 + ls -al
 total 24
 drwx-- 2 jenkins jenkins 4096 Oct 30 23:48 .
 drwxr-xr-x 9 jenkins jenkins 4096 Oct 31 17:34 ..
 -rw-rw-r-- 1 jenkins jenkins   43 Oct 30 23:48 config
 -rw--- 1 jenkins jenkins 1675 Oct 27 14:09 id_rsa
 -rw-r--r-- 1 jenkins jenkins  410 Oct 27 14:09 id_rsa.pub
 -rwx-- 1 jenkins jenkins 1306 Oct 28 22:20 known_hosts
 + cat id_rsa.pub
 [MY PUBLIC KEY ...]


 *
 *
 *Burkhard Reffeling*

 Software Engineer



 On 31 October 2012 17:02, Vincent Latombe 
 vincent.lato...@gmail.comjavascript:_e({}, 'cvml', 
 'vincent.lato...@gmail.com');
  wrote:

 Hi,

 you should check that the HOME variable is defined and accessible to the
 Jenkins process (or to the slave that is executing the task). I remember
 having the same kind of issue running git clients.

 Hope that helps,

 Vincent



 2012/10/31 Burkhard Reffeling 
 burkhard.reffel...@gmail.comjavascript:_e({}, 'cvml', 
 'burkhard.reffel...@gmail.com');
 

 Hi all,

 I've got a Jenkins build that runs a Capistrano deploy as a post-build
 action.

 Running the Capistrano task as the Jenkins user from the console works
 absolutely fine and without a password prompt (I've previously set up SSH
 keys on both build and staging server). However, when running the same
 script through Jenkins, I suddenly get a password prompt and the build
 subsequently fails (no TTY present).

 [workspace] $ /bin/sh -xe /tmp/hudson7321493219694918714.sh
 Performing Post build task...
 Match found for : : True
 Logical operation result is TRUE
 Running script  : cap _2.13.4_ deploy
 [workspace] $ /bin/sh -xe /tmp/hudson1545664641721322948.sh
 + cap _2.13.4_ deploy
   * executing `deploy'
   * executing `deploy:update'
  ** transaction: start
   * executing `deploy:update_code'
 triggering before callbacks for `deploy:update_code'
 [32m-- Updating code base with checkout strategy[0m
 executing locally: git ls-remote 
 g...@my.staging-server.com:my_project.git
 master
 command finished in 1200ms
   * executing git clone -q g...@my.staging-server.com:my_project.git
 /var/www/staging/my_project/releases/20121029223619  cd
 /var/www/staging/my_project/releases/20121029223619  git checkout -q -b
 deploy 1fb11d669a6cb5a714d077162305dfcfaba82f01  (echo
 1fb11d669a6cb5a714d077162305dfcfaba82f01 
 /var/www/staging/my_project/releases/20121029223619/REVISION)
 servers: [my.staging-server.com]
 Password: stty: standard input: Inappropriate ioctl for device
 stty: standard input: Inappropriate ioctl for device
 stty: standard input: Inappropriate ioctl for device

 *** [deploy:update_code] rolling back
   * executing rm -rf
 /var/www/staging/my_project/releases/20121029223619; true
 servers: [my.staging-server.com]
  ** [deploy:update_code] exception while rolling back:
 Capistrano::ConnectionError, connection failed for:
 my.staging-server.com (Net::SSH::AuthenticationFailed: not-specified)
 connection failed for: 
 my.staging-server.com(Net::SSH::AuthenticationFailed: not-specified)
 POST BUILD TASK : FAILURE



 It looks like Ruby doesn't pick my SSH key up when running through
 Jenkins perhaps (`Net::SSH::AuthenticationFailed: not-specified`)?


 Does anyone have an idea what might be going wrong here?






How to conditionally build down-stream projects?

2012-10-31 Thread Nick Martin
I have a fairly complicated Jenkins job that builds, unit tests and
packages a web application. Depending on the situation, I would like to do
different things once this job completes. I have not found a
re-usable/maintainable way to do this. Is that really the case or am I
missing something?

The options I would like to have once my complicated job completes:

1. Do nothing

2. Start my low-risk-change build pipeline:
  - copies my WAR file to my artifact repository
  - deploys to production

3. Start my high-risk-change build pipeline:
  - copies my WAR file to my artifact repository
  - deploys to test environment
  - run acceptance tests
  - deploy to production

I have not found an easy way to do this. The simplest, but not very
maintainable, approach would be to make three separate jobs, each of which
kicks off a downstream build. This approach scares me for a few reasons
including the fact that changes would have to be made in three places
instead of one. In addition, many of the downstream jobs are also nearly
identical. The only difference is which downstream jobs they call. The
proliferation of jobs seems like it would lead to an un-maintainable mess.

I have looked at using several approaches to keep this as one job, but none
have worked so far:

1. Make the job a multi-configuration project (
https://wiki.jenkins-ci.org/display/JENKINS/Building+a+matrix+project).
This provides a way to inject the job with a parameter. I have not found a
way to make the build other projects step respond to a parameter.

2. Use the Parameterized-Trigger plugin (
https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin).
This plugin lets you trigger downstream-jobs based on certain triggers. The
triggers appear to be too restrictive though. They're all based on the
state of the build, not arbitrary variables. I don't see any option
provided here that would work for my use case.

3. Use the Flexible Publish plugin (
https://wiki.jenkins-ci.org/display/JENKINS/Flexible+Publish+Plugin). This
plugin has the opposite problem as the parameterized-trigger plugin. It has
many useful conditions it can check, but it doesn't look like it can start
building another project. Its actions are limited to publishing type
activities.

4. Use Flexible Publish + Any Build Step plugin (
https://wiki.jenkins-ci.org/display/JENKINS/Any+Build+Step+Plugin). The Any
Build Step plugin allows making any build action available to the Flexible
Publish plugin. While more actions were made available once this plugin was
activated, those actions didn't include build other projects.

5. Use the Conditional Build Step plugin (
https://wiki.jenkins-ci.org/display/JENKINS/Conditional+BuildStep+Plugin).
This plugin looks like it only lets you create conditional build steps, not
conditional *post*-build steps.

Is there really not an easy way to do this? I'm surprised that I haven't
found it and even more surprised that I haven't really seen any one else
trying to do this? Am I doing something unusual? Is there something obvious
that I am missing?

PS I also posted on StackOverflow last week, but didn't get any good
answers there.
http://stackoverflow.com/questions/13091488/how-to-conditionally-build-other-projects


RE: How to conditionally build down-stream projects?

2012-10-31 Thread Neerenberg, Aaron
Nick-

Not the best, but here's a thought.


1.During your build, evaluate which post build action you would like, 
and echo some sort of semaphore based on that state

2.   Configure 2 post build-steps for your job, each with conditional text 
from the log file.  Conditional text to match is your semaphore that you echo.

3.   Because the parameterized build step won't allow conditionality, have 
your post build steps perform a wget or curl call to the URL of the downstream 
jobs to trigger depending on which you want to do.

4.   You will need to modify the downstream jobs to allow remote triggering.
-Aaron

From: jenkinsci-users@googlegroups.com 
[mailto:jenkinsci-users@googlegroups.com] On Behalf Of Nick Martin
Sent: Wednesday, October 31, 2012 2:55 PM
To: jenkinsci-users@googlegroups.com
Subject: How to conditionally build down-stream projects?

I have a fairly complicated Jenkins job that builds, unit tests and packages a 
web application. Depending on the situation, I would like to do different 
things once this job completes. I have not found a re-usable/maintainable way 
to do this. Is that really the case or am I missing something?

The options I would like to have once my complicated job completes:

1. Do nothing

2. Start my low-risk-change build pipeline:
  - copies my WAR file to my artifact repository
  - deploys to production

3. Start my high-risk-change build pipeline:
  - copies my WAR file to my artifact repository
  - deploys to test environment
  - run acceptance tests
  - deploy to production

I have not found an easy way to do this. The simplest, but not very 
maintainable, approach would be to make three separate jobs, each of which 
kicks off a downstream build. This approach scares me for a few reasons 
including the fact that changes would have to be made in three places instead 
of one. In addition, many of the downstream jobs are also nearly identical. The 
only difference is which downstream jobs they call. The proliferation of jobs 
seems like it would lead to an un-maintainable mess.

I have looked at using several approaches to keep this as one job, but none 
have worked so far:

1. Make the job a multi-configuration project 
(https://wiki.jenkins-ci.org/display/JENKINS/Building+a+matrix+project). This 
provides a way to inject the job with a parameter. I have not found a way to 
make the build other projects step respond to a parameter.

2. Use the Parameterized-Trigger plugin 
(https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin). 
This plugin lets you trigger downstream-jobs based on certain triggers. The 
triggers appear to be too restrictive though. They're all based on the state of 
the build, not arbitrary variables. I don't see any option provided here that 
would work for my use case.

3. Use the Flexible Publish plugin 
(https://wiki.jenkins-ci.org/display/JENKINS/Flexible+Publish+Plugin). This 
plugin has the opposite problem as the parameterized-trigger plugin. It has 
many useful conditions it can check, but it doesn't look like it can start 
building another project. Its actions are limited to publishing type activities.

4. Use Flexible Publish + Any Build Step plugin 
(https://wiki.jenkins-ci.org/display/JENKINS/Any+Build+Step+Plugin). The Any 
Build Step plugin allows making any build action available to the Flexible 
Publish plugin. While more actions were made available once this plugin was 
activated, those actions didn't include build other projects.

5. Use the Conditional Build Step plugin 
(https://wiki.jenkins-ci.org/display/JENKINS/Conditional+BuildStep+Plugin). 
This plugin looks like it only lets you create conditional build steps, not 
conditional *post*-build steps.

Is there really not an easy way to do this? I'm surprised that I haven't found 
it and even more surprised that I haven't really seen any one else trying to do 
this? Am I doing something unusual? Is there something obvious that I am 
missing?

PS I also posted on StackOverflow last week, but didn't get any good answers 
there. 
http://stackoverflow.com/questions/13091488/how-to-conditionally-build-other-projects


Re: How to conditionally build down-stream projects?

2012-10-31 Thread Benjamin Lau
You can get a conditional behavior with the Parameterized Trigger
plug-in actually.  I have mine set to use a properties file and if the
properties file doesn't exist... the triggered build will not run.

I manage the creation of the properties file using a shell build step
with the following hunk of code:
if [[ ${parameter} == true ]]
then
  cat -  ${WORKSPACE}/trigger.properties XXX
triggered_job_parameter1=value2
triggered_job_parameter2=value2
XXX
fi

Make sure Trigger build without parameters is unchecked.

Ben

On Wed, Oct 31, 2012 at 3:10 PM, Neerenberg, Aaron
aaron.neerenb...@fei.com wrote:
 Nick-



 Not the best, but here’s a thought.



 1.During your build, evaluate which post build action you would
 like, and echo some sort of semaphore based on that state

 2.   Configure 2 post build-steps for your job, each with conditional
 text from the log file.  Conditional text to match is your semaphore that
 you echo.

 3.   Because the parameterized build step won’t allow conditionality,
 have your post build steps perform a wget or curl call to the URL of the
 downstream jobs to trigger depending on which you want to do.

 4.   You will need to modify the downstream jobs to allow remote
 triggering.

 -Aaron



 From: jenkinsci-users@googlegroups.com
 [mailto:jenkinsci-users@googlegroups.com] On Behalf Of Nick Martin
 Sent: Wednesday, October 31, 2012 2:55 PM
 To: jenkinsci-users@googlegroups.com
 Subject: How to conditionally build down-stream projects?



 I have a fairly complicated Jenkins job that builds, unit tests and packages
 a web application. Depending on the situation, I would like to do different
 things once this job completes. I have not found a re-usable/maintainable
 way to do this. Is that really the case or am I missing something?



 The options I would like to have once my complicated job completes:



 1. Do nothing



 2. Start my low-risk-change build pipeline:

   - copies my WAR file to my artifact repository

   - deploys to production



 3. Start my high-risk-change build pipeline:

   - copies my WAR file to my artifact repository

   - deploys to test environment

   - run acceptance tests

   - deploy to production



 I have not found an easy way to do this. The simplest, but not very
 maintainable, approach would be to make three separate jobs, each of which
 kicks off a downstream build. This approach scares me for a few reasons
 including the fact that changes would have to be made in three places
 instead of one. In addition, many of the downstream jobs are also nearly
 identical. The only difference is which downstream jobs they call. The
 proliferation of jobs seems like it would lead to an un-maintainable mess.



 I have looked at using several approaches to keep this as one job, but none
 have worked so far:



 1. Make the job a multi-configuration project
 (https://wiki.jenkins-ci.org/display/JENKINS/Building+a+matrix+project).
 This provides a way to inject the job with a parameter. I have not found a
 way to make the build other projects step respond to a parameter.



 2. Use the Parameterized-Trigger plugin
 (https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin).
 This plugin lets you trigger downstream-jobs based on certain triggers. The
 triggers appear to be too restrictive though. They're all based on the state
 of the build, not arbitrary variables. I don't see any option provided here
 that would work for my use case.



 3. Use the Flexible Publish plugin
 (https://wiki.jenkins-ci.org/display/JENKINS/Flexible+Publish+Plugin). This
 plugin has the opposite problem as the parameterized-trigger plugin. It has
 many useful conditions it can check, but it doesn't look like it can start
 building another project. Its actions are limited to publishing type
 activities.



 4. Use Flexible Publish + Any Build Step plugin
 (https://wiki.jenkins-ci.org/display/JENKINS/Any+Build+Step+Plugin). The Any
 Build Step plugin allows making any build action available to the Flexible
 Publish plugin. While more actions were made available once this plugin was
 activated, those actions didn't include build other projects.



 5. Use the Conditional Build Step plugin
 (https://wiki.jenkins-ci.org/display/JENKINS/Conditional+BuildStep+Plugin).
 This plugin looks like it only lets you create conditional build steps, not
 conditional *post*-build steps.



 Is there really not an easy way to do this? I'm surprised that I haven't
 found it and even more surprised that I haven't really seen any one else
 trying to do this? Am I doing something unusual? Is there something obvious
 that I am missing?



 PS I also posted on StackOverflow last week, but didn't get any good answers
 there.
 http://stackoverflow.com/questions/13091488/how-to-conditionally-build-other-projects


Re: How to conditionally build down-stream projects?

2012-10-31 Thread cjo
Regarding the item 
2. Use the Parameterized-Trigger plugin (
https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin). 
This plugin lets you trigger downstream-jobs based on certain triggers. The 
triggers appear to be too restrictive though. They're all based on the 
state of the build, not arbitrary variables. I don't see any option 
provided here that would work for my use case.

There is a pull request to add the functionality of the flexible publish 
plugin in to it and all the conditions with it. See pull request 
https://github.com/jenkinsci/parameterized-trigger-plugin/pull/17

Chris

On Wednesday, October 31, 2012 10:43:36 PM UTC, benjamin.a.lau wrote:

 You can get a conditional behavior with the Parameterized Trigger 
 plug-in actually.  I have mine set to use a properties file and if the 
 properties file doesn't exist... the triggered build will not run. 

 I manage the creation of the properties file using a shell build step 
 with the following hunk of code: 
 if [[ ${parameter} == true ]] 
 then 
   cat -  ${WORKSPACE}/trigger.properties XXX 
 triggered_job_parameter1=value2 
 triggered_job_parameter2=value2 
 XXX 
 fi 

 Make sure Trigger build without parameters is unchecked. 

 Ben 

 On Wed, Oct 31, 2012 at 3:10 PM, Neerenberg, Aaron 
 aaron.ne...@fei.com javascript: wrote: 
  Nick- 
  
  
  
  Not the best, but here’s a thought. 
  
  
  
  1.During your build, evaluate which post build action you would 
  like, and echo some sort of semaphore based on that state 
  
  2.   Configure 2 post build-steps for your job, each with 
 conditional 
  text from the log file.  Conditional text to match is your semaphore 
 that 
  you echo. 
  
  3.   Because the parameterized build step won’t allow 
 conditionality, 
  have your post build steps perform a wget or curl call to the URL of the 
  downstream jobs to trigger depending on which you want to do. 
  
  4.   You will need to modify the downstream jobs to allow remote 
  triggering. 
  
  -Aaron 
  
  
  
  From: jenkins...@googlegroups.com javascript: 
  [mailto:jenkins...@googlegroups.com javascript:] On Behalf Of Nick 
 Martin 
  Sent: Wednesday, October 31, 2012 2:55 PM 
  To: jenkins...@googlegroups.com javascript: 
  Subject: How to conditionally build down-stream projects? 
  
  
  
  I have a fairly complicated Jenkins job that builds, unit tests and 
 packages 
  a web application. Depending on the situation, I would like to do 
 different 
  things once this job completes. I have not found a 
 re-usable/maintainable 
  way to do this. Is that really the case or am I missing something? 
  
  
  
  The options I would like to have once my complicated job completes: 
  
  
  
  1. Do nothing 
  
  
  
  2. Start my low-risk-change build pipeline: 
  
- copies my WAR file to my artifact repository 
  
- deploys to production 
  
  
  
  3. Start my high-risk-change build pipeline: 
  
- copies my WAR file to my artifact repository 
  
- deploys to test environment 
  
- run acceptance tests 
  
- deploy to production 
  
  
  
  I have not found an easy way to do this. The simplest, but not very 
  maintainable, approach would be to make three separate jobs, each of 
 which 
  kicks off a downstream build. This approach scares me for a few reasons 
  including the fact that changes would have to be made in three places 
  instead of one. In addition, many of the downstream jobs are also nearly 
  identical. The only difference is which downstream jobs they call. The 
  proliferation of jobs seems like it would lead to an un-maintainable 
 mess. 
  
  
  
  I have looked at using several approaches to keep this as one job, but 
 none 
  have worked so far: 
  
  
  
  1. Make the job a multi-configuration project 
  (https://wiki.jenkins-ci.org/display/JENKINS/Building+a+matrix+project). 

  This provides a way to inject the job with a parameter. I have not found 
 a 
  way to make the build other projects step respond to a parameter. 
  
  
  
  2. Use the Parameterized-Trigger plugin 
  (
 https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin). 

  This plugin lets you trigger downstream-jobs based on certain triggers. 
 The 
  triggers appear to be too restrictive though. They're all based on the 
 state 
  of the build, not arbitrary variables. I don't see any option provided 
 here 
  that would work for my use case. 
  
  
  
  3. Use the Flexible Publish plugin 
  (https://wiki.jenkins-ci.org/display/JENKINS/Flexible+Publish+Plugin). 
 This 
  plugin has the opposite problem as the parameterized-trigger plugin. It 
 has 
  many useful conditions it can check, but it doesn't look like it can 
 start 
  building another project. Its actions are limited to publishing type 
  activities. 
  
  
  
  4. Use Flexible Publish + Any Build Step plugin 
  (https://wiki.jenkins-ci.org/display/JENKINS/Any+Build+Step+Plugin). 
 The Any 
  Build Step plugin 

How to change the concurrent build path separator?

2012-10-31 Thread Jason Swager
When marking a job as able to run concurrently on the same node, Jenkins 
will append a @X (where X is the number of the concurrent build) to the 
normal workspace directory to get a new, unique workspace directory. 
 Normally, this is all fine and good, but we've encountered a couple tools 
that cannot handle a @ in the path name even though the operating system 
can.

Is there some way to change the @ character to something else?  Say maybe a 
double underscore (__) or something?
Thanks,
Jason 


Trouble with xUnit plug-in on OS X? The plugin hasn't been performed correctly: remote file operation failed

2012-10-31 Thread Jonathan Rice


I can't get even a supposedly simple JUnit test working on my OS X Jenkins 
system. Can anyone give any advice? I have a test script which just prints the 
following dummy JUnit XML text to $(WORKSPACE)/dummy_junit.xml:


?xml version=1.0 encoding=UTF-8?
testsuites tests=3 failures=1 errors=0 time=35 name=AllTests
  testsuite name=MathTest tests=2 failures=1* errors=0 time=15
testcase name=Addition status=run time=7 classname=
  failure message=Value of: add(1, 1) Actual: 3 Expected: 2 type=/
  failure message=Value of: add(1, -1) Actual: 1 Expected: 0 type=/
/testcase
testcase name=Subtraction status=run time=5 classname=
/testcase
  /testsuite
  testsuite name=LogicTest tests=1 failures=0 errors=0 time=5
testcase name=NonContradiction status=run time=5 classname=
/testcase
  /testsuite
/testsuites


Running on either a slave or the master, Jenkins finds the XML file fine, 
but it then fails with The plugin hasn't been performed correctly: remote 
file operation failed:


[xUnit] [INFO] - Starting to record.
[xUnit] [INFO] - Processing JUnit
[xUnit] [WARNING] - Can't create the path 
/tmp/master/workspace/dummy_junit/generatedJUnitFiles. Maybe the directory 
already exists.
[xUnit] [INFO] - [JUnit] - 1 test report file(s) were found with the pattern 
'dummy_junit.xml' relative to '/tmp/master/workspace/dummy_junit' for the 
testing framework 'JUnit'.
[xUnit] [ERROR] - The plugin hasn't been performed correctly: remote file 
operation failed: /tmp/master/workspace/dummy_junit at 
hudson.remoting.Channel@6deb6c9:master
Build step 'Publish xUnit test result report' changed build result to FAILURE
Build step 'Publish xUnit test result report' marked build as failure
Finished: FAILURE


I've found mention of this error in one or two previous discussions, but with 
no resolution. Is this likely to be something as simple as file permissions or 
something? Is there any way to get further debugging information out of this?