Situation:
- I have a symfony2 project in a private github repository.
This project has vendor dependencies, one of which is in a different private repository. I do not own this repo, but I am a contributor and can read/write. It is added to the project using composer in the following manner:
"repositories": [{ "type": "vcs", "url": "git@github.com:company/dependency.git" }], "require": {"company/dependency": "~1.0"}
I have set up PHPCI my test server, added the main project, set up a cron job, all "according to the manual".
- I generated an SSH key on this server (in /root/.ssh), and added the key to my personal github account.
- As root, I can clone the main project repository and the dependency repository on this test server manually.
But when running a build in PHPCI, I get the following message:
Cloning into '/var/www/phpci/PHPCI/build/10'...
Working copy created: /
RUNNING PLUGIN: composer
Using --prefer-source flag
Loading composer repositories with package information
Failed to clone the git@github.com:company/dependency.git repository,
try running in interactive mode so that you can enter your GitHub credentials
[RuntimeException]
Failed to execute git clone --mirror 'git@github.com:company/dependency.git' '/root/.composer/cache/vcs/git-github.com-company-dependency.git/'
So the vendor dependency can't be retrieved due to authentication problems. But the main project, also in a private repository, is being cloned without any problems by PHPCI.
The cronjob and composer are running as root, the /var/www/phpci/PHPCI/build
folder is filled with builds owned by root. So why does it successfully clone the project, but not the dependency?
What would be the best way to fix this?