Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

merge two jobs in jenkins.

 
Punit Jain
Ranch Hand
Posts: 1012
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Punit Jain
Ranch Hand
Posts: 1012
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 605
7
Mac OS X Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just add the update module process to the build process (xml file) in ant.
 
Punit Jain
Ranch Hand
Posts: 1012
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1012
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic