DevShop Git Repo Management
Last updated
Last updated
Many components of the devshop framework are included in one single "megarepo".
This page documents how to add new components that need to be split up into separate git repos, and how to import existing git repos into new components.
DevShop is a DevOps framework. It contains many components that work independently.
These components are pushed out to other git repos as Composer Packages.
To add a new component follow these steps:
Pick a name for the component. Try to use two words, CamelCase. A component
can include many classes, so group them logically.
Create a new directory in using the component name.
Copy the folderinto . src/DevShop/Component
and rename it.
Add a the component code. This folder will become a standalone Composer package.
Follow the direction of the repository. See the for an example of best practices.
Create a git repository on GitHub:
Select devshop-packages
as the owner.
Add the same purpose statement from the README.md
to the Description field.
Format the repository name by converting CamelCase ComponentName to component-name
.
Set it to Public.
DO NOT SELECT Initialize this repository with a README, Add .gitigire or Add a license. The GitSplit tool will populate this repo.
Press "Create Repository" to create the new git repo.
Add the package name to the replace
section of . If the component is required by the devshop
CLI, add it to require
instead as "devshop/component-name": "*"
.
Add the Secondary Repository information to the config.git-split.repos
section of the main file.
Use the path within the opendevshop/devshop
repo to the component as the key of the array element, and the git repo URL as the value.
It should look something like this:
Create a new branch from develop
and push it:
Use the branch naming convention component/php/git-split
.
NOTE: GitHub now provides a direct link to the "Create Pull Request" page after you push a new branch. Look for this in the output of the first git push
command on a new branch.
Once you feel your component is read for review by the DevShop Team, submit a Pull Request!
If a component repo exists already, you can merge it in with the git subtree
command.
Create a new branch from develop
first, then pull in the tree:
Then submit a PR against develop
branch.
This list is changing rapidly. We'll try to keep it up to date with status.
GitSplit - Composer command and bin script to run splitsh-lite. This is used to split the monorepo.
Symfony solved how to build a big repo with many components.
Refer to Symfony/symfony codebase for examples.
Useful examples include:
As soon as you push this new branch, (even before you submit a pull request), GitHub Actions will run our workflows on your branch. Check the for the Git Management workflow results.
See for a good explanation.
Commit to add a new Component: