在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
前边有介绍以及运行过基于nexus proxy 模式的php composer(其中也有一些坑),以下是关于host 模式的 环境准备
version: "3"
services:
nexus:
image: jbuncle/nexus-repository-composer
volumes:
- "./nexus-data:/nexus-data"
ports:
- "8081:8081"
简单项目集成
{
"config": {
"secure-http": false
},
"version": "1.0",
"name": "dalongdemo",
"description": "this is a demo composer repo",
"authors": [{
"name": "dalong",
"email": "[email protected]"
}],
"require": {
"monolog/monolog": "1.0.*",
"pugx/shortid-php":"v0.5.1"
},
"repositories": {
"packagist": {
"type": "composer",
"url": "http://localhost:8081/repository/demo/"
}
}
}
composer archive --format=zip
curl -v --user 'user:password' --upload-file dalongdemo-1.0.tar http://localhost:8081/repository/myhost-composer/packages/upload/dalongrong/dalongdemo/1.0
引用发布的软件包
{
"config": {
"secure-http": false
},
"name": "dalong/dalong",
"authors": [
{
"name": "rongfengliang",
"email": "[email protected]"
}
],
"repositories": [
{
"type": "composer",
"url": "http://localhost:8081/repository/myphp-group/"
},
{
"packagist.org": false
}
],
"require": {
"dalongrong/dalongdemo":"1.0"
}
}
composer install --no-dev
Loading composer repositories with package information
Warning: Accessing localhost over http which is an insecure protocol.
Updating dependencies
Package operations: 8 installs, 0 updates, 0 removals
- Installing symfony/polyfill-mbstring (v1.12.0): Downloading (100%)
- Installing paragonie/random_compat (v2.0.18): Downloading (100%)
- Installing paragonie/sodium_compat (v1.12.1): Downloading (100%)
- Installing ircmaxell/security-lib (v1.1.0): Downloading (100%)
- Installing paragonie/random-lib (v2.0.0): Downloading (100%)
- Installing pugx/shortid-php (v0.5.1): Downloading (100%)
- Installing monolog/monolog (1.0.2): Downloading (100%)
- Installing dalongrong/dalongdemo (1.0): Downloading (100%)
Writing lock file
Generating autoload files
参考资料https://github.com/sonatype-nexus-community/nexus-repository-composer |
2022-08-17
2022-11-06
2022-08-17
2022-07-18
2022-07-18
请发表评论