Daniel, Thank You for the quick response.

We are seeing "seemingly random" behavior. Sometimes the downstream Job B is 
triggered and other times it is not.

If we needed to change the template as you stated, wouldn't the downstream job 
never get triggered? Why would it work sometimes but not others?

-----Original Message-----
From: jenkinsci-users@googlegroups.com 
[mailto:jenkinsci-users@googlegroups.com] On Behalf Of Daniel Beck
Sent: Monday, August 26, 2013 3:34 PM
To: jenkinsci-users@googlegroups.com
Subject: Re: "Build after other projects are built" question

'Build after other projects are built' is actually stored in the _triggering_ 
job as a post-build action. Check the config.xml's of the triggering and 
triggered jobs. It's just a UI trick that you're able to configure this from 
the downstream job.

Any of the following will cause a job's template transformation to run again:
- Changing the template, even those parts that aren't related to the 
transformation, like the name of the template, its description, or the 
description of the attributes
- Saving the config page of a templated job

Performing these action will override the entire job configuration on the 
affected templated jobs, including the following parts, unless specifically 
accounted for in the template transformation:
- enabled/disabled status of the job (as this can be changed outside /config 
page)
- job description (can also be changed outside /config page)
- RBAC permissions (!)
- 'Build other projects' (the inverse of 'Build after other projects are built')
- ...

To circumvent this, you need to specifically account for all of these in your 
template transformation. For example, the following Groovy template snippet 
keeps the job description during transformation: 
<description>${instance.job?.description?:""}</description>

Related RM entries:
https://rm.cloudbees.com/issues/2016 (make it easier to keep previous job 
values)
https://rm.cloudbees.com/issues/1780 (make it easier to serialize more complex 
structures, like e.g. a hudson.tasks.BuildTrigger publisher)
https://rm.cloudbees.com/issues/1979 (don't save all jobs when changing parts 
of the template that don't affect the templates jobs at all)

On 26.08.2013, at 19:47, Bob Bick <bb...@netjets.com> wrote:

> Hi,
>  
> We are using the "Build after other projects are built" feature...
>  
> Job B is triggered to run after Job A runs. Job A is based on a CloudBees 
> Template. The build trigger is set on Job B, not Job A.
>  
> Sometimes it works correctly (i.e. Job A runs and Job B is triggered. When it 
> works correctly, I will see something like this on a Job B run:
>  
> Started by upstream project 
> flight-review/weather-review-application-ci build number 308 originally 
> caused by:
>       * Started by an SCM change
> However, a lot of times, Job B does not get triggered when Job A runs 
> successfully.
>  
> Has anyone else ran into this issue? If so, any ideas what might be the 
> problem?
>  
> Thanks,
> Bob
> 
> *** *** ***
> This message contains information which may be confidential and privileged. 
> Unless you are the addressee (or authorized to receive for the addressee), 
> you may not use, copy or disclose to anyone the message or any information 
> contained in the message. If you have received the message in error,  please 
> advise the sender by reply e-mail and delete the message.
> 
> 
> --
> 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.

*** *** ***
This message contains information which may be confidential and privileged. 
Unless you are the addressee (or authorized to receive for the addressee), you 
may not use, copy or disclose to anyone the message or any information 
contained in the message. If you have received the message in error,  please 
advise the sender by reply e-mail and delete the message.

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

Reply via email to