I took a while to findout how to clone a external gitlabrepository via composer in a project
if your repository is available via git + ssh you have to create a ssh key
follow this link to do so
https://help.github.com/articles/generating-ssh-keys/
at next you have to add your ssh key to ssh-agent
exec ssh-agent bash
ssh-add ~/.ssh/id_rsa
composer.json in the root of your project
{
"repositories": [
{
"type":"vcs",
"url":"git@gitlab:root/testproject2.git"
}
],
"require": {
"peter1/peter2": "dev-master"
},
"target-dir":"test"
}
peter1/peter2 = name of the repository in composer.json of repo you want to clone
target-dir = name of the directory in local folder "vendor"
the project you want to clone via composer needs a composer.json too.
{
"name": "peter1/peter2",
"description": "My New Project",
"authors": [
{
"name": "Peter Böthig",
"email": "mail@mymail.com"
}
]
}
Keine Kommentare:
Kommentar veröffentlichen