Git / Mercurial: separate repositories in the structure

I am trying to switch to Composer / Packagist , and for this purpose I am trying to figure out how best to manage my workflow so that I can create pacakges composer with my selection and application map, but damn if I can figure out the way to do it with Git / Github or Hg / BitBucket (or both).

Current structure / workflow

%path%/sites/[framework] - contains up to date framework git repo %path%/sites/[framework]/application - contains app specific code and is a bitbucket repo *%path%/www/[appname]_public - contains public files and is a bitbucket repo ie "public_html" folder 

With the proper alias, this works for my current sites (each site is a separate folder in "/ sites"). And since I use two separate repo mechanisms, I can update the framework for this particular site whenever I want it to not damage my application and vice versa.

Since packages are contained as subfolders of the application folder (so I can create and test them), how can I β€œwrap” these folders as packages as separate repositories so that I can provide them as standalone composer packages on github or a bitpack? I was a little confused.

 %path%/sites/[framework]/application/[module] - contains controllers, models, views, etc... to be wrapped up as a composer "package" and made available on github or bitbucket as its own repo. 

Perhaps someone here can give me a hand with logic about this or how to set it up, since I cannot figure out how to do this. Is it possible? Can I / think about a problem?

Maybe my whole way of thinking is wrong. With my existing structure, I tried to complete the task, but Git Submodules or HG nested repositories do not work as I expected.

Is my workflow a serious flaw or do I need more Git knowledge for this? Is there an easier / better way? I will happily rebuild my structure / workflow if I can save Framework / SiteApplicationCode / Packages as separate repositories with some mechanism / logic that I am missing.

Thanks in advance for any help.

+4
source share
1 answer

% path% / sites / [framework] / application / [module] should be the git repository that you pass on to others by clicking on some public (public for your company only if you want) location, say git.yourcompany.com.

Then you can create a satis satellite repository available on satis.company.com, which you will initialize with a json file that links to your public repositories. First, make sure you create a composer.json file for each of your modules to make them linkers.

Then reinstall your project using the composer.json file for each application that will extract the necessary modules in the desired version. They will appear in% path% / sites / [framework] / application / vendor / and a startup file will be created.

If your code can be published on github, you can skip the git + satis part and submit your modules to packagist.org

I may have misunderstood your structure, but hope you understand the idea

+1
source

Source: https://habr.com/ru/post/1440788/


All Articles