Skip to content

Add Composer Project Service

This commit adds the per-project option to expose a project as a composer package. It generates and maintains a packages.json file (conforming to https://getcomposer.org/doc/05-repositories.md) in the public/ folder, allowing the GitLab install to be used as a Composer repository.

Note: There is a known issue integrating with the GitLab-Omnibus, namely that the public folder is owned by 'root' and GitLab is run as 'git'. 
I'm still working on a suitable workaround and am open to input on solutions.

Please see feature thread http://feedback.gitlab.com/forums/176466-general/suggestions/5953067-provide-composer-package-repository-support

When a project that has activated the composer service receives a push, the public /packages.json file will be refreshed to include version definitions for every branch and tag in the project's repository.

Sample Output

{
  "packages": {
    "deja/example": {
      "5.26.7": {
        "name": "deja/example",
        "type": "sample",
        "time": "2014-05-27 20-28-05",
        "version": "5.26.7",
        "version_normalized": "5.26.7.0",
        "source": {
          "url": "git@git.example.com:deja/example.git",
          "type": "git",
          "reference": "2e9418c5136b24049533152779b4012a1becad5f"
        }
      },
      "dev-master": {
        "name": "deja/example",
        "type": "sample",
        "require": {
          "deja/some-library": "*"
        },
        "time": "2014-10-29 14-55-33",
        "version": "dev-master",
        "version_normalized": "9999999-dev",
        "source": {
          "url": "git@git.example.com:deja/example.git",
          "type": "git",
          "reference": "c35f345773ea342201dd0a760b46f15bf49ba096"
        }
      }
    },
    "deja/some-library": {
      "dev-master": {
        "name": "deja/some-library",
        "type": "library",
        "time": "2014-10-29 14-50-12",
        "version": "dev-master",
        "version_normalized": "9999999-dev",
        "source": {
          "url": "git@git.example.com:deja/some-library.git",
          "type": "git",
          "reference": "21bd2acb4a26882c88227d3bc2cbdfbab858d767"
        }
      }
    }
  }
}

Merge request reports