As mentioned in Checkout multiple git repos into same Jenkins workspace, you nowodays (2017) needs to use Pipeline+Plugin in order to build multiple Git repo in the same job.
The idea behind pipeline is that you can store it as a file (called jenkinsfile) in its own Git repo and define one Jenkins job (type "pipeline"), which will look for that Jenkinfile
See this example using the dir
basic step:
dir: Change current directory
Change current directory.
Any step inside the dir
block will use this directory as current and any relative path will use it as base path.
That same example uses gradle which knows how to build multiple projects.
The OP Mohan S. used the -C
option I mentioned here:
The following command worked.
git -C mohan_test pull || git clone -b mohan_branch --single-branch ssh://mohan.s@100.101.102.103:29418/mohan_test mohan_test –