Gitlab Composer repository

Small script that loops through all branches and tags of all projects in a Gitlab installation and if it contains a composer.json, adds it to an index.

This is very similar to the behaviour of Packagist.org

See example.

Installation

  1. Run composer.phar install
  2. Copy confs/samples/gitlab.ini into confs/gitlab.ini, following instructions in comments
  3. Ensure cache is writable
  4. Change the TTL as desired (default is 60 seconds)
  5. Ensure an alias exists for /packages.json => /packages.php (.htaccess is provided)

Usage

Simply include a composer.json in your project, all branches and tags respecting the formats for versions will be detected.

Only requirement is that the package name must be equal to the path of the project. i.e.: my-group/my-project. This is not a design requirement, it is mostly to prevent common errors when you copy a composer.json from another project without changing its name.

Then, to use your repository, add this in the composer.json of your project:

{
    "repositories": [
        {
            "type": "composer",
            "url": "http://gitlab-composer.stage.wemakecustom.com/"
        }
    ]
}

Caveats

While your projects will be protected through SSH, they will be publicly listed. If you require protection of the package list, I suggest this reading.

Author



Gitlab Composer repository

在Gitlab安装中循环遍历所有项目的所有分支和标签的小脚本 如果它包含一个 composer.json ,则将其添加到索引。

这与Packagist.org

的行为非常相似

请参见示例

安装

  1. Run composer.phar install
  2. Copy confs/samples/gitlab.ini into confs/gitlab.ini, following instructions in comments
  3. Ensure cache is writable
  4. Change the TTL as desired (default is 60 seconds)
  5. Ensure an alias exists for /packages.json => /packages.php (.htaccess is provided)

用法

只需在您的项目中包含一个composer.json,所有的分支机构和标签即可 将检测版本的格式

仅需要的是 name 包必须等于项目的路径。即: my-group / my-project 。 这不是一个设计要求,它主要是为了防止常见的错误,当你复制一个 composer.json 来自另一个项目而不更改其名称。

然后,要使用您的存储库,请在项目的 composer.json 中添加:

{
    "repositories": [
        {
            "type": "composer",
            "url": "http://gitlab-composer.stage.wemakecustom.com/"
        }
    ]
}

警告

虽然您的项目将通过SSH进行保护,但它们将被公开列出。 如果您需要保护软件包列表,请我建议此阅读

作者




相关问题推荐