user3392555 February 2016

Composer vcs install on Gitolite

I created a library on my gitolite server with a composer.json

{
    "name": "package/package-name",
    "type": "library",
    "description": "Wine Extension for Wordpress",
    "keywords": ["Page Management"],
    "license": "MIT",
    "authors": [
        {
            "name": "Author",
            "email": "author@email.com"
        }
    ],
    "require": {
        "php": ">=5.3.2"
    },
    "autoload": {
      "psr-4": { "Prefix\\PackageName\\": "src/" }
    },
    "extra": {
        "branch-alias": {
            "dev-master": "master"
        }
    }
}

And then I want to include them in other project, so I add on my repositories like this.

[
    "repositories": [
        {
            "type": "vcs",
            "url": "git@my-server.com:Library/PackageName"
        }
    ],
    "require": {
        "package/package-name": "master",
    },
]

I have exact the same composer.json file on another library on github. However on Github it works, but not on gitolite. I wonder if this has something to do with the Gitolite, if the Gitolite doesn't support it. Can someone explain to me? on github, the package also not available on Packagist. So I think this should not be the problem.

The error I got from Gitolite:

Your requirements could not be resolved to an installable set of packages.

Problem 1
    - The requested package package/package-name could not be found in any version, there may be a typo in the package name.

Potential causes:
    - A typo in the package name
    - The package is not available in a stable-enough version according to your minimum-stability setting
    see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

both "dev-master" or "master" are not working.

but if I require the package like this, it works.

{
  "type": "package",
  "package": {
    "name": "package/package-nam        

Answers


Sven February 2016

If you want to use a branch, you have to prefix it's name with dev-, so it's dev-master, not master.

Also note that you have to explicitly mention all the repositories where your software resides, otherwise indirect inclusions will not work.

Composer only knows about packages from packagist.org and from repositories in the root composer.json file. Including a package that includes another package from your Gitolite would not work.

Post Status

Asked in February 2016
Viewed 1,555 times
Voted 4
Answered 1 times

Search




Leave an answer