Library for working with Git repositories and PHP as a monorepo
This package is auto-updated.
Last update: 2023-11-22 03:15:32 UTC
A PHP library for working with Monorepo Project's. This library handles splitting of sub folder commits and pushing of tags into multiple remote repositories which depends on a
.monorepo config file in your monorepo's working directory.
$ composer require biurad/monorepo
This library main purpose is for continuously splitting up a monorepo project into multiple repositories as read-only. Handles splitting of branches and tags, this library is truly extendable as you can define different worker classes for a particular job run. splitsh/lite is used under the hood for great performance.
NB: It is highly recommended to have git filter-repo installed as this allows re-merging of multiple repositories as many times as you want, the default way merges once an can be very risky to re-merge.
In order to use this library, a
.monorepo yaml syntax config file must exists in project working directory.
Here is an example of the .monorepo config:
# URL or absolute path to the remote GIT repository of the monorepo base_url: https://github.com/YOUR-VENDORNAME/YOUR-PROJECT.git # Base directories where sub repo paths can be found base_path: ['packages', 'plugins'] # All branches that match this regular expression will be split by default branch_filter: /^(main|develop|\d+\.\d+)$/ # A list of workers which should run when the monorepo command is called workers: main: - Biurad\Monorepo\Worker\SplitCommitsWorker # - Custom\MonorepoWorker merge: - Biurad\Monorepo\Worker\MergeRepoWorker #release: # - Biurad\Monorepo\Worker\PushNextDevWorker # List of all split projects repositories: # The first split project living in the folder /first-subfolder first-subfolder: # URL or absolute path to the remote GIT repository url: https://github.com/YOUR-VENDORNAME/YOUR-FIRST-SPLIT-PROJECT.git # Second split project living in the folder /second-subfolder second-subfolder: # URL or absolute path to the remote GIT repository url: https://github.com/YOUR-VENDORNAME/YOUR-SECOND-SPLIT-PROJECT.git # A path which exist in `base_path` or an absolute path to sub repo # If not defined, this config key (second-subfolder) is used as path path: php-example # If true, Repo supports merging & splitting. If false, only splitting is supported merge: true # An array of configuration's which custom workers may rely on extra: ~
This library uses a single workflow command that takes in one argument which is the specified job name (default is main) and a bunch of options required by class workers. You can also use this library in your CI workflow, if you seek to have all commits and tags created while running this library in GitHub Actions CI signed. Then checkout crazy-max/ghaction-import-gpg repository to enable such feature.
To use run this library simply run this command in your terminal:
$ php vendor/bin/monorepo
If this library made it into your project, or you interested in supporting us, please consider donating to support future development.
- Martin Auswöger developed the contao/monorepo-tools library which inspired this library.
- Divine Niiquaye Ibok is the author this library.
- All Contributors who contributed to this project.
Poakium Monorepo is completely free and released under the BSD 3 License.