Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Hudson » Attempting to set up a Build Once Deploy Many job chain using several Hudson plugins, but ...
Attempting to set up a Build Once Deploy Many job chain using several Hudson plugins, but ... [message #947062] Tue, 16 October 2012 19:32 Go to next message
Eric Wood is currently offline Eric WoodFriend
Messages: 4
Registered: October 2012
Junior Member
I'm trying to set up some chained jobs in Hudson to implement a "Build Once Deploy Many" process. What I want is the first job in my chain to be a CI job that builds, tests, and archives the build assets so that subsequent jobs can deploy the build in a promoted way through the environments (i.e. DEV->QA->UAT->PROD). In other words, the next job in the chain should be a deployment job to development. After that is a deployment job to QA, then a deployment job to a certification environment and finally a deployment job to PRODUCTION.

I attempting to use a variety of plugins to accomplish this task, but I am not getting the correct configuration in place to achieve what I want. Currently, I have two jobs, Job A as my CI job and Job B as my deployment to DEv job. I'm using the:

Out of the Box Solution:
Job A has
Post Build Actions: "Build other Projects" check-box checked
Projects to build: Job B

Job B has:
Build Triggers: "Build after other projects are built" check-box checked
Project Names: Job A


Copy Artifact Plugin: I'm using this plugin to assure that the downstream project "B" as the build artifacts (i.e. the deploy-able assets) from the CI Job "A".
Job A has:
Source Code Management: "Clone workspace" radio button checked
Parent Project: Job A
Criteria for parent build: Most Recent Successful Build
Job B has:
Build: "Copy artifacts from another project" selected
Which Build: Last Successful build
Artifacts to copy: **


Jenkins Clone Workspace Plugin: I'm using this to assure that the downstream Job B has the same workspace that was used for the upstream CI Job A. This workspace contains a build.xml that has deploy logic as well and build logic.

Job A has:
Post Build Actions: "Archive for Clone Workspace SCM" check-box checked
Criteria for build to be archived: "Most Recent Successful Build"
Job B has:

Hudson Parameterized Trigger Plugin: I'm trying to use this plugin to get the build assets from a given build my passing in the source build number BUILD_NUMBER. I was assuming that I could use this as opposed to the Copy Artifacts plugin to gain access to the deploy-able assets from any CI build.

Job A has:
Post Build Actions: "Trigger parameterized build on other projects" check-box checked
Build Trigger "Projects to build" Job B
Trigger when build is "Stable"
Predefined parameters: BUILD_SELECTOR=<SpecificBuildSelector><buildNumber>$BUILD_NUMBER</buildNumber></SpecificBuildSelector>
Job B has:
I passed the BUILD_SELECTOR to my ant build and did not see the values set.


Any help on setting this up correctly would be greatly appreciated.
Re: Attempting to set up a Build Once Deploy Many job chain using several Hudson plugins, but ... [message #947069 is a reply to message #947062] Tue, 16 October 2012 19:40 Go to previous messageGo to next message
Steve Christou is currently offline Steve ChristouFriend
Messages: 125
Registered: June 2012
Location: Milwaukee, Wisconsin
Senior Member

It sounds like your setup is very sound proof. I was wondering what you mean by "I am not getting the correct configuration in place to achieve what I want". And what sort of help you need with setting it up?

/**
 * @author Steven Christou
 * @dev    Hudson-ci
 */
Re: Attempting to set up a Build Once Deploy Many job chain using several Hudson plugins, but ... [message #947923 is a reply to message #947069] Wed, 17 October 2012 15:25 Go to previous messageGo to next message
Winston Prakash is currently offline Winston PrakashFriend
Messages: 534
Registered: August 2011
Location: Fremont, CA USA
Senior Member
Hi Eric, as Steve mentioned, it would help if you explain what actually happens when you expect the chain to be CI->DEV->QA->UAT->PROD.

You mentioned Job A has "Build other Projects" (downstream) checked and Job B has "Build after other projects are built" (upstream). You need either one of this, not both (unless your Job B has special setup to test the build artifacts of A).

Couple of Questions

- How does B do the deployment? Is it a deployment to some appserver
- What is the promotion process you adopted?

I can think of few options

Option1: only B does the deployment to DEV, QA, UAT, PROD based on A outcome. Automation may be little complicated, because it is a one-one with different deployment strategy.

Option 2: You can have more the one Job like Job A (CI) -> Job B (deploy to DEV) -> Job C (Deploy to QA) -> Job D (Deploy UAT) -> Job E (Deploy to PROD). This set up is one-to-one is a chanined fashion. In this case the promotion is manual and at each stage.

Option 3: Depending on some parameter in Job A, and its outcome, trigger
Job A (CI) -> Job B (deploy to DEV)
Job A (CI) -> Job C (deploy to QA)
Job A (CI) -> Job D (deploy to UAT)
Job A (CI) -> Job E (deploy to PROD)
This is one-to-many

I'm guessing Option 1 is complicated. Option 2 requires manual intervention. Option 3 may be a fit for you, but need to be setup correctly using both parameterized and promoted build plugin (wiki.hudson-ci.org/display/HUDSON/Promoted+Builds+Plugin)




Winston Prakash
Eclipse Hudson team
Re: Attempting to set up a Build Once Deploy Many job chain using several Hudson plugins, but ... [message #948001 is a reply to message #947923] Wed, 17 October 2012 16:59 Go to previous message
Eric Wood is currently offline Eric WoodFriend
Messages: 4
Registered: October 2012
Junior Member
Steve, Winston:

Thanks for your reply. What I'm looking at doing in more along the lines of option 2 in Winston's response:

Option 2: You can have more the one Job like:
Job A (CI) -> Job B (deploy to DEV) -> Job C (Deploy to QA) -> Job D (Deploy UAT) -> Job E (Deploy to PROD).
This set up is one-to-one is a chained fashion. In this case the promotion is manual and at each stage.

I want to force a promoted deployment path. In other words, you can't deploy to QA without having first deployed to DEV and you can't deploy to UAT without having first deployed to QA. In the ideal state, I would be able to re-deploy a build to DEV if I wanted to be able to revert back to a previous release.

I was unable to get the Trigger Parameterized Build plugin to work. My assumption is that I can set environment variables to use in the upstream job to be passed as name/value pairs to the downstream job. When I attempted to pass the values to my ANT Build, I was unable to read the values.

Can you point me to a reference on how to best accomplish this task?

Thanks, Eric
Previous Topic:Can hudson deploy to a resin server
Next Topic:Configuration restore failed
Goto Forum:
  


Current Time: Thu Apr 18 11:56:19 GMT 2024

Powered by FUDForum. Page generated in 0.02564 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top