简体   繁体   English

Azure Devops Pipelines 中的工件

[英]Artifacts in Azure Devops Pipelines

I have an azure devops pipeline that publishes output like this:我有一个 azure devops 管道,可以像这样发布输出:

steps:
- script: ./something.sh
  displayName: build
- publish: $(System.DefaultWorkingDirectory)/app/build
  artifact: MyPackage

This works, and publishes a build artefact, but it's not available in the Artifacts page of Azure devops, and the only way to get to it is through an http url.这有效,并发布了一个构建工件,但它在 Azure devops 的工件页面中不可用,唯一的方法是通过 http url。 Is there some way to publish the artefact to the Artifacts page?有没有办法将人工制品发布到人工制品页面? In addition, the url to the artefact has the buildid in it.此外,人工制品的 url 中包含 buildid。 Is there a way I can specify semver version numbers?有没有办法可以指定 semver 版本号?

If you want to have your package available in Azure Artifacts you should publish it to feed.如果你想让你的包在 Azure Artifacts 中可用,你应该将它发布到 feed。 Here you have an example with Universal Package. 这里有一个通用包的例子。

Speaking about SemVer (from link above):谈到 SemVer(来自上面的链接):

In Universal Packages, a particular package is identified by its name and version number.在通用包中,特定包由其名称和版本号标识。 Currently, Universal Packages require Semantic Versioning.目前,通用包需要语义版本控制。 Semantic version numbers have three numeric components, Major.Minor.Patch.语义版本号具有三个数字组件,Major.Minor.Patch。 When you fix a bug, you increment the patch (1.0.0 to 1.0.1).当你修复一个错误时,你增加了补丁(1.0.0 到 1.0.1)。 When you release a new backward-compatible feature, you increment the minor version and reset the patch version to 0 (1.4.17 to 1.5.0).当您发布新的向后兼容功能时,您会增加次要版本并将补丁版本重置为 0(1.4.17 到 1.5.0)。 When you make a backward-incompatible change, you increment the major version and reset the minor and patch versions to 0 (2.6.5 to 3.0.0).当您进行向后不兼容的更改时,您会增加主要版本并将次要版本和补丁版本重置为 0(2.6.5 到 3.0.0)。

The Universal Packages task automatically selects the next major, minor, or patch version for you when you publish a new package.发布新包时,通用包任务会自动为您选择下一个主要、次要或补丁版本。 Just set the appropriate option.只需设置适当的选项。

And you build/pipeline artifact you will find here:您将在此处找到构建/管道工件: 在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM