Creates a Satis file to generate a private Composer repository.
composer install
make start
docker exec -it satis_builder_php php src/generate.php var/sample/input var/sample/output
Input file sample:
# Path where the libraries are located
path_pre: /projects/%s/php-libs/%s
#path_pre: https://github.com/%s/%s
# Optional: Path where each library contains its code
path_post: code
packages:
- yosmanyga/lib-1
- yosmanyga/lib-2Output file:
{
"name": "satis",
"description": "PHP Packages",
"homepage": "http://localhost:8080",
"repositories": [
{
"name": "yosmanyga/lib-1",
"type": "vcs",
"url": "/projects/yosmanyga/php-libs/lib-1/code"
},
{
"name": "yosmanyga/lib-2",
"type": "vcs",
"url": "/projects/yosmanyga/php-libs/lib-2/code"
}
],
"require-all": true
}You can modify the path_pre and path_post to fit your needs. The %s will
be replaced by the package name parts.
You can also modify the satis template, located in src/satis.json.mustache.
When satis rebuilds, it clones every repo listed in the input YAML. If an entry's repo doesn't exist
yet (gitea transfer not done), the clone fails and satis aborts the whole rebuild, deleting the
existing packages.json. Any subsequent composer update against the satis URL then gets HTTP 404
for every package — not just the new one — until the YAML entry is removed and the rebuild re-run.
Rule: transfer/create the gitea repo first, verify it's reachable, then add the YAML entry and rebuild satis. Never add a YAML entry speculatively.
If satis already deleted packages.json: remove the premature entry from the YAML, rebuild, and the
existing packages return.