我正在使用VSTS vNext构建系统来构建C#解决方案.您可以在下面看到NuGet Packager的设置.nuspec文件的路径设置为引用.csproj文件.
但是这包括所有.csproj文件; 我需要排除测试项目.忽略'Core.Test.csproj'但仍然打包'Core.csproj'.
我试过' *.csproj; - :! *test.csproj'和其他组合,但没有运气搞清楚这一点!有谁知道模式匹配如何适用于vNext构建?
我希望获取我作为工件推送到 Azure DevOps 的文件的内容
通过使用此 API,我能够获得带有工件 zip 网址的 json 响应
https://dev.azure.com/uifabric/cd9e4e13-b8db-429a-9c21-499bf1c98639/_apis/build/builds/8838/artifacts?artifactName=drop&api-version=5.0
Run Code Online (Sandbox Code Playgroud)
但是,我真正想要的是bundlesizes.json在此 zip 中调用的文件的内容。
我确实在这里遇到了 Get File API ,它提到了一个 API,如下所示
GET https://dev.azure.com/{organization}/{project}/_apis/build/builds/{buildId}/artifacts?artifactName={artifactName}&fileId={fileId}&fileName={fileName}&api-version=5.0
Run Code Online (Sandbox Code Playgroud)
我尝试按如下方式替换它
https://dev.azure.com/uifabric/fabricpublic/_apis/build/builds/8838/artifacts?artifactName=drop&fileId=bundlesizes.json&fileName=bundlesizes.json&api-version=5.0
Run Code Online (Sandbox Code Playgroud)
我认为我缺少的是fileId字段,我不知道需要输入什么。文档说fileId是文件的主键。但是,我不知道在哪里可以找到它。
azure-devops azure-pipelines-build-task azure-pipelines-release-pipeline azure-artifacts azure-devops-rest-api
我的组织正在将我们的软件包(NuGet、NPM)迁移到 Azure Artifacts。我们已将大约 50,000 个 NuGet 包 (2GB) 推送到 Azure Artifacts。
如果我们对产品不满意,有没有办法将我的包从 Azure Artifacts 批量拉取到我的计算机或 Azure blob 存储?我主要关心的是提取我们的 NuGet 包,因为我们发布了数千个包。
我知道从私人 nuget feed 下载所有包,但我想知道是否有办法检索所有包的 zip 文件,或者使用其他方法批量下载所有包。
谢谢!
我正在尝试通过以下方式下载存储在 Azure DevOps 上的通用包:
az artifacts universal download --feed my-feed --name my-cool-package --version 1.0.0 --path Downloads
Run Code Online (Sandbox Code Playgroud)
该包内有一个文件my-file.dll。我收到的错误是:
Encountered an unexpected error.
System.IO.IOException: Hard linking failed!
Status: Failed
Path: Downloads\my-file.dll
at Microsoft.VisualStudio.Services.BlobStore.WebApi.DedupStoreClient.DownloadToFileAsync(DedupNode node, String fullPath, Uri proxyUri, EdgeCache edgeCache, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.BlobStore.WebApi.DedupStoreClientWithDataport.DownloadToFileAsync(IDedupDataPort dataport, DedupNode node, String fullPath, Uri proxyUri, EdgeCache edgeCache, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.BlobStore.WebApi.DedupStoreClientWithDataport.DownloadToFileAsync(IDedupDataPort dataport, DedupIdentifier dedupId, String fullPath, UInt64 fileSize, GetDedupAsyncFunc dedupFetcher, Uri proxyUri, EdgeCache edgeCache, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.BlobStore.WebApi.DedupManifestArtifactClient.<>c__DisplayClass24_0.<<DownloadAsyncWithManifestPath>b__5>d.MoveNext()
--- End of stack trace …Run Code Online (Sandbox Code Playgroud) 我创建了一个私有 npm 包,并将其发布到 Azure Artifacts。为了发布我的 npm 包,我的 tfs 构建定义中有一个 npm 发布步骤。我使用的是tfs版本16.131.28507.4。
这一切都按预期进行。但是,如果在 npm 包版本未更改的情况下触发构建,则 npm 发布将失败并出现403禁止。此错误导致我的其余构建失败。npm 包是较大项目的一部分,因此在 npm 包未更改的情况下进行构建并不罕见。
npm publish如果我的包提要中的当前版本与包 json 中指定的版本相同,是否可以阻止执行 tfs 构建步骤运行?
我知道构建步骤中的“自定义条件”,但不确定如何将 Azure Artifacts 当前发布的版本与我的package.json. 我还知道构建定义中的“错误时继续”选项,但这会创建部分成功的构建,在这种情况下我想避免这种情况。
我有一个 npm 包的提要,其中 npmjs 设置为上游源(默认情况下)。当您尝试使用其他依赖项安装上传的自定义包时,这些依赖项包会自动保存在您的源中,以节省将来安装的时间。然而,我不想要它,并希望我的提要仅托管我自己的软件包,并且每次安装时都从上游源下载。有没有办法做到这一点?
我们想与我们公司的内部客户共享一个指向通用包的 URL。打开链接即可直接下载引用的通用包文件。
我知道我可以使用 Azure CLI 来实现相同的目标,但强制人们安装并正确配置 Azure CLI 仅用于下载包文件并不理想。
因此,我很感兴趣是否有一种方法可以提供通用包的直接下载链接。
谢谢
在我的项目中,需要自动创建 Azure 工件源。
为此,我使用了本文档中提到的 REST API:https://learn.microsoft.com/en-us/rest/api/azure/devops/artifacts/feed%20%20management/create%20feed ?view=azure-devops -休息-5.0
并使用 python 来创建 feed。
POST https://feeds.dev.azure.com/{organization}/_apis/packaging/feeds?api-version=5.0-preview.1 工作正常。
后来我看到有新版本的API可用了。每次有新的 API 版本时都更改代码并不容易。那么问题是如何始终识别/使用最新的稳定工作版本的 API?
我们的组织内有许多项目。其中一个项目创建了一个项目范围的 Azure Artifact 源,他们希望与我们的其他项目共享。
但是,当其他项目访问其工件页面时,从提要下拉列表中,他们只能看到“组织范围的提要”,而“项目范围的提要”下没有任何内容。我们需要做什么才能使此源可见并可供其他项目使用,特别是在他们的管道中使用。
我很茫然,因为到目前为止我完全一片空白。
我今天遇到了一个随机发生的问题,即我的所有 DevOps Pipelines 无法再访问我的 NuGet feed,这是一个 DevOps Artifact。
我有一个任务负责安装 AzureSignTool,下面是该任务的 YAML。windows-latest我正在Microsoft 托管代理上使用该图像。
- task: CmdLine@2
displayName: 'Install AzureSignTool'
inputs:
script: |
set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
dotnet tool install --global AzureSignTool --version 4.0.1
Run Code Online (Sandbox Code Playgroud)
这是因以下错误而失败的任务。
未处理的异常:NuGet.Protocol.Core.Types.FatalProtocolException:无法加载 source 的服务索引。---> System.Net.Http.HttpRequestException:响应状态代码不表示成功:401(未经授权)。
我已经检查了提要的权限,并且可以确认它们Project\Build Administrators已设置为所有者。
我还尝试了各种其他操作,包括更改代理上的 NuGet 版本、更改 AzureSignTool 的版本等。
我应该检查哪些权限/设置?
因此,我将 RestoreNuGetPackages 任务移到 InstallAzureSignTool 之前,并且该任务成功,因此显然它可以毫无问题地进行身份验证。
然而任务仍然失败。我什至添加了--ignore-failed-sources但这没有效果。
错误消息已更改,但根本问题是相同的。
[NuGet Manager] [Info] GET https://api.nuget.org/v3/registration5-gz-semver2/azuresigntool/index.json
[NuGet Manager] [Info] GET https://{ORG}.pkgs.visualstudio.com/_packaging/{GUID}/nuget/v3/registrations2-semver2/azuresigntool/index.json
[NuGet Manager] [Info] Unauthorized https://{ORG}.pkgs.visualstudio.com/_packaging/{GUID}/nuget/v3/registrations2-semver2/azuresigntool/index.json 767ms
[NuGet Manager] [Info] OK https://api.nuget.org/v3/registration5-gz-semver2/azuresigntool/index.json 1010ms
Unhandled …Run Code Online (Sandbox Code Playgroud) azure-artifacts ×10
azure-devops ×7
azure ×2
npm ×2
artifacts ×1
azure-pipelines-release-pipeline ×1
npm-publish ×1
tfs ×1
tfsbuild ×1