4

I have a project in my bitbucket repository and I'm a very newbie with composer

In this project I have composer.json with all my require and settings.

I'm trying to install my project directly from my bitbucket repo, what i want to do it's the same things we can do with a github project for example.

For example:

composer create-project thelia/thelia-project path/ 2.2.0

But if I execute this command:

composer create-project vendor/name .--repository-url=https://vendor@bitbucket.org/vendor/name.git

the result is:

https://vendor@bitbucket.org/vendor/name.git/packages.json could not be downloaded

I have already inserted my ssh key on bitbucket for deploy

I committed a packages.json to name.git repository but it doesn't work.

This command obviously is wrong:

composer create-project vendor/name . --repository-url=git@bitbucket.org:vendor/name.git

the result is:

Invalid repository url given. Has to be a .json file or an http url

I read somewhere that composer create-project act as git clone and composer install, but I'm not able to let it work in the right way.

What's wrong? I found a lot of answer here but I wasn't able to let them works.

Sven
  • 69,403
  • 10
  • 107
  • 109
theex
  • 63
  • 1
  • 6

1 Answers1

6

From the composer documentation:

--repository-url: Provide a custom repository to search for the package, which will be used instead of packagist. Can be either an HTTP URL pointing to a composer repository, or a path to a local packages.json file.

This means this parameter can only be used for a replacement of Packagist, not as a pointer to one single package. There is no parameter to do what you want.

However, you don't need to use create-project, because all it does is clone the repository, and run composer install on it's dependencies. You can do that by hand.

Note that cloning the repository will not change any metadata. You'd still have to do this by hand even if create-project had worked. I think this is a flaw in the way how create-project currently works, making it less useful.

Sven
  • 69,403
  • 10
  • 107
  • 109