目 录CONTENT

文章目录

composer配置nexus私库实现拉去推送

chenming
2021-06-10 / 0 评论 / 0 点赞 / 158 阅读 / 0 字 / 正在检测是否收录...

推送

composer.json

在项目根目录下新建composer.json,里面进行如下配置

{
  "repositories": [
    {
      "type": "composer",
      "url": "http://172.28.118.19:8100/repository/rcd_composer_local/"
    }
  ]
}

其中url是hosted私库的url

打包成zip

composer archive --format=zip

如果不出问题,会生成__root__-1.0.0+no-version-set.zip

推送

curl -v --user admin:<PASSWORD> --upload-file __root__-1.0.0+no-version-set.zip http://172.28.118.19:8100/repository/rcd_composer_local/packages/upload/<AUTHOR>/<PACKAGENAME>/<VERSION>

url是:hosted库的url/packeages/upload/AUTHOR/PACKAGENAME/VERSION

拉取

composer.json

以vendor/cmtest为例,vendor对应推送中的,cmtest对应推送中的

拉取该composer,可以如下配置composer.json

{
    "config": {
        "secure-http": false
    },
    "repositories": [
        {
            "type": "composer",
            "url": "http://172.28.118.19:8100/repository/rcd_composer_group/"
        },
        {
            "packagist.org": false
        }
    ],
    "require": {
        "vendor/cmtest":"1.0.0"
    }
}

url为group库的url
image

拉取

composer install
0

评论区