ARTIFACTORY:在ARTIFACTORY中使用巧克力包装
通过Artifactory中的NuGet存储库,我们可以设置处理巧克力包的能力。按照以下步骤和命令进行设置:
设置一个nuget远程存储库指向"https://chocolatey.org,并创建一个虚拟的Nuget存储库“chocolate - Nuget”,并在Artifactory中包含上述远程以及本地的Nuget存储库。
在客户端中添加源代码:巧克力源add -n artifactory -s="https://xxx.jfrog。Io /artifactory/api/nuget/chocolatey-nuget"——优先级1——绕过代理——allow-self- self
针对Artifactory进行身份验证:Choco apikey -s "https://xxx.jfrog。io/artifactory/api/nuget/chocolatey-nuget" -k admin:密码
巧克力的安装:Choco安装packagename——version=x。X -s "https://xxx.jfrog。io/artifactory/api/nuget/chocolatey-nuget"
您也可以在安装命令中使用以下命令传递用户名和密码:Choco安装packagename——version=x。X -s "https://xxx.jfrog。io/artifactory/api/nuget/chocolatey-nuget" -u admin -p密码
在请求日志中,下载请求如下所示:2022-06-07T22:42:13.558Z|39353fe562ff4e1c|35.202.14.212|admin|GET|/api/nuget/chocolate -nuget/Download/packagename/packageversion|200|-1|4438|11| nuget Core/1.1.0.0 (Microsoft Windows NT 10.0.20348.0)
推送包装到Artifactory:巧克力推送packagename -s "https://xxx.jfrog.io/artifactory/api/nuget/chocolatey-nuget"
在request.log中,上传请求如下所示:2022-06-07T23:32:52.700Z|935e784ac76409a4|35.202.14.212|admin|PUT|/api/nuget/ Chocolatey -nuget/pacakagename|201|7933|0|273|Chocolatey Command Line/1.1.0.0 (Microsoft Windows NT 10.0.20348.0)
