使用BaGet搭建私有nuget源
搭建过程
修改配置
运行
dotnet BaGet.dll
运行效果如下
上传
dotnet nuget push -s http://localhost/v3/index.json package.nupkg
如果设置了秘钥以后可通过setapikey命令配置
nuget setapikey <key> -Source <url> [options]
例如
nuget setapikey 4003d786-cc37-4004-bfdf-c4f3e8ef9b3a -source https://example.com/nugetfeed
导入原有nuget
for /f "delims=" %%f in ('dir /b /a-d-h-s') do (
rem echo %%f
dotnet nuget push -s http://localhost:8080/v3/index.json %%f
)
删除包
dotnet nuget delete -s http://127.0.0.1/v3/index.json test 1.0.0
centos部署
- 导入微软源
sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
- 安装对应版本
sudo yum install aspnetcore-runtime-3.1
- 部署成服务
创建start.sh
#!/bin/bash
cd /server/baget # 需要注意此处的路径切换
dotnet Baget.dll &
系统服务目录中新增baget.service 路径为: /usr/lib/systemd/system
[Unit]
Description=baget services
After=network.target
[Service]
Type=forking
ExecStart=//opt/baget/BaGet/start.sh
PrivateTmp=true
[Install]
WantedBy=multi-user.target
设置开机启动
systemctl enable baget
启动服务
systemctl start baget
留待后查,同时方便他人
联系我:renhanlinbsl@163.com
联系我:renhanlinbsl@163.com