Is it possible to install a package from a repository on Gitlab using Composer?

前端 未结 1 783
半阙折子戏
半阙折子戏 2020-12-31 02:19

I am trying to get composer to download a library from my repository on Gitlab, however, it does not have a composer.json file in it so I\'m not sure if this is possible.

相关标签:
1条回答
  • 2020-12-31 02:33

    I found the answer and it works for me here (the last answer, not the accepted answer):

    Using Composer and Private Repository on GIthub using VCS on Build Server

    This is what I make it works:

        "repositories": [
          {
            "type": "package",
            "package": {
              "name": "username/repository",
              "version": "0.1.0",
              "type": "package",
              "source": {
                  "url": "git@gitlab.com:username/repository.git",
                  "type": "git",
                  "reference": "master"
              }
            }
          }
        ],
        "require": {           
            "username/repository": "*"
        },
    
    0 讨论(0)
提交回复
热议问题