Merge Git Core Repo and Site Repo folder while Jenkins deployment

26 views
Skip to first unread message

kamlesh nattamai ramesh babu

unread,
Sep 26, 2016, 11:50:18 AM9/26/16
to Jenkins Users
Hi Folks, 

I need your advice badly.. We are Maintaining  2 GIT repo for handling code. 

1. Core repo: This repo contains the core files which is commonly used for all the projects as a core base files.
2. Site repo: This repo contains the site wise file which will merge with core while GIT deployment.

Both CORE and SITE will get merged with each other while doing the GIT deployment.  We maintain the CORE plugins in the core repo and site wise plugins in site repo. So both the repo will contain the same folder name called "WP-CONTENT" which contain core plugins in core repo and site plugins in site repo. Both the folder will get merged while deploying the code thru GIT. I want to make this process automate thru JENKIN deployment but it is not happening. 

I would like you guys share your esteemed knowledge to make this sort out..

Thanks,
Kamlesh

Indra Gunawan (ingunawa)

unread,
Sep 26, 2016, 5:02:48 PM9/26/16
to jenkins...@googlegroups.com
Use git submodules  or git sparse checkout and you have to do it in cmd line git CLI in your Linux BuildStep instead of using “git” Jenkins plugin.

--
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-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/46e509ed-2734-41e1-9d31-76c17f43bffb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark Waite

unread,
Sep 26, 2016, 8:24:04 PM9/26/16
to jenkins...@googlegroups.com
On Mon, Sep 26, 2016 at 9:50 AM kamlesh nattamai ramesh babu <nrka...@gmail.com> wrote:
Hi Folks, 

I need your advice badly.. We are Maintaining  2 GIT repo for handling code. 

1. Core repo: This repo contains the core files which is commonly used for all the projects as a core base files.
2. Site repo: This repo contains the site wise file which will merge with core while GIT deployment.


I assume in my comments below that the verb "merge" in the above comment means "combine the files from both git repositories into a single directory.  I assume in my comments below that the verb "merge" does not mean "perform the 'git merge' command across two git repositories".

If those assumptions are wrong, then my comments should be ignored.
 
Both CORE and SITE will get merged with each other while doing the GIT deployment.  We maintain the CORE plugins in the core repo and site wise plugins in site repo. So both the repo will contain the same folder name called "WP-CONTENT" which contain core plugins in core repo and site plugins in site repo. Both the folder will get merged while deploying the code thru GIT. I want to make this process automate thru JENKIN deployment but it is not happening. 


The Jenkins git plugin can't combine the contents of two different repositories into the same root workspace folder.  Thus, you can't use the Jenkins git plugin to have a single job workspace root folder which contains both CORE and SITE repositories at its root.

You can (with the pipeline plugin, or with the multiple SCM's plugin) checkout multiple repositories into subdirectories of the workspace root folder.  You could then run a build step which combines the contents of the "WP-CONTENT" directory from each of those subdirectories into a single subdirectory of your choosing inside the workspace.

I'm not sure what you mean when you say "Both the folder will get merged while deploying the code thru GIT".

Thanks,
Mark Waite
 
I would like you guys share your esteemed knowledge to make this sort out..

Thanks,
Kamlesh

--

kamlesh nattamai ramesh babu

unread,
Sep 27, 2016, 7:08:17 AM9/27/16
to Jenkins Users
Thanks very much Mark Waite, I was looking for the similar kind of solution.

You are right , My expectation is to combine 2 folders of "WP-CONTENT" from the different repositories(CORE & SITE) while JENKINS deployment. We make the changes only on the site wise "WP-CONTENT". But finally when we do the JENKINS deployment I would need to COMBINE the WP-CONTENT folders from the CORE along with the site repository which belongs to a particular site and contains the recent changes. 

It would be helpful for me if you have the script handy for the same experiment ..

Thanks again for your worthy suggestions..

Thanks,
Kamlesh 

Mark Waite

unread,
Sep 28, 2016, 2:50:46 PM9/28/16
to Jenkins Users
I'm sorry, but I don't have a script handy to do that.  You might investigate the "ant" build tool and its "copy" task.

Mark Waite

Reply all
Reply to author
Forward
0 new messages