Azure Devops,如何使`trifactoryDotnetnetcore失败
我有一个管道,该管道使用artifactorydotnetcore@1
将nuget软件包上传到 artifactory 。如果找不到软件包,任务成功,将其吐出到日志中:
{
"status": "success",
"totals": {
"success": 0,
"failure": 0
}
}
问题是,如果“成功”为0
。似乎仅适用于还原
命令,而不是我正在使用的 push 。 在 jfrog 文档中,我看不到任何有用的东西,也看不到源代码。
我看到了可能的解决方案:
- 其用于目的
- 我错过了一些无证件参数,可以使用其他任务将
- 从任务(可能在以下任务中)解析输出
- ,可以以某种方式将其发布到文物中,并从任务(可能在以下任务中)手动构建和调用
jfrog.exe rt u ...
作为命令行,
有人可以告诉我(1),(2)或(3)可以实现,还是我必须撤退到(4)?
I have a pipeline that uses ArtifactoryDotnetCore@1
for uploading a Nuget package to Artifactory. If a package was not found, the tasks succeeds, spitting out this into the log:
{
"status": "success",
"totals": {
"success": 0,
"failure": 0
}
}
The question is how to make it fail if "success" is 0.
I tried using an arguments
input parameter, but it seems to only work with the restore
command, not push
that I am using.
I can't see anything useful in the JFrog documentation, and I can't see the source code.
I see possible solutions:
- I missed some undocumented parameter, that can be used for the purpose
- Using a different task, that can publish to Artifactory
- Somehow retrieve and parse the output from the task (probably in the following task)
- Manually build and call
jfrog.exe rt u ...
as a command line
Can somebody tell me whether (1), (2) or (3) can be achieved, or do I have to retreat to (4)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在寻找的是失败 - no-op选项,如果没有上传文件,它会使任务失败。
该选项当前不适用于
文物dotnet core
任务(请随意打开一个功能请求)。解决方法将使用
trifactory通用上传
任务。幕后这两个任务都运行了Jfrog CLI的RT上传
命令。在此任务上,您可以检查“如果没有上传文件,则失败任务”
复选框。我认为解析输出是不可行的。
对于参考,请注意,此处提到的任务属于较旧的扩展名,
文物Azure DevOps扩展
。一个新的扩展名,Jfrog Azure DevOps扩展
,使用Jfrog CLI V2。请参阅有关新扩展的信息。What you are looking for is the fail-no-op option, that fails the tasks if no files were uploaded.
That option is currently not available for the
Artifactory Dotnet Core
tasks (feel free to open a feature request).A workaround would be using the
Artifactory Generic Upload
task. Behind the scenes both of these tasks run thert upload
command of JFrog CLI. On this task you can check the"Fail task if no files were uploaded"
checkbox.I don't think parsing the output is feasible.
For reference, note that the tasks mentioned here belong to the older extension,
Artifactory Azure DevOps Extension
. A new extension,JFrog Azure DevOps Extension
, that uses JFrog CLI v2 is available. See info about the the new extension here.