GeeCON Prague 2014*
The moose likes IDEs, Version Control and other tools and the fly likes merge two jobs in jenkins. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "merge two jobs in jenkins." Watch "merge two jobs in jenkins." New topic
Author

merge two jobs in jenkins.

Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 1000
    
    2
i created two jobs in jenkins, (i.e. : one is for build and other is for update modules) now i have to merge these two jobs, how do i do that?

please consider me as new to jenkins.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

What do you mean by "update modules"?

What build tool or script language do you use? Ant? Maven? Something else?

The possibilities are usually to either change your build script to do both tasks, or to add an additional step (or post step) to the first Jenkins build.


JBoss In Action
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 1000
    
    2

What do you mean by "update modules"?

it is just a job, for ex. to update modules.


What build tool or script language do you use? Ant? Maven? Something else?

Ant

The possibilities are usually to either change your build script to do both tasks, or to add an additional step (or post step) to the first Jenkins build.

how?
i mean where do i find that.
please i am new to this.
Steve Fahlbusch
Bartender

Joined: Sep 18, 2000
Posts: 563
    
    7

Just add the update module process to the build process (xml file) in ant.
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 1000
    
    2

Just add the update module process to the build process (xml file) in ant.

okay, but how?
you mean, at the time of creating new job, i gave ant path, there any xml file is created for this jobs and all and there i need to add?
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

I assume that you have two build.xml files, one for doing the build, one for doing the "update modules" (I still have no idea what it means to update modules...). So one of you options is to combine the two build.xml files into one that does the tasks for both. How easy or difficult that is depends on the contents of the build.xml files - if you carefully crafted them, you should be able to copy the ""update modules" related tasks to the build.xml file that does the build.

If you want to, instead, add the "update modules" job to the existing build job in Jenkins, for the build job, click on the Configure link, then scroll down to the Build section or Post Steps section. Click on the button that allows you to add a build step or post-build step. The button should have a drop-down menu that gives options, select Invoke Ant, and then provide the details as to run the "update module" script. You might also have to add an additional source control URL in the Source Code Management section if the "update modules" build.xml file is not part of the same source code as the source code used for "build".
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

Another thought - Jenkins lets you specify that after finishing one job that another job should be run. This can be done on the Configure page, in the Post Build Actions section, just check the Build other projects option. So for the build job you could add running the "update modules" job as a post build action.
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 1000
    
    2
Thank you Peter for your nice explanation.
the problem was, we had a clearcase view and i need to update that view in the build job itself.
for this we our company has their own plugin and in that we has option update view that i selected.
 
GeeCON Prague 2014
 
subject: merge two jobs in jenkins.