【问题标题】:AzureDevOps - Cache Task in Release PipelineAzureDevOps - 发布管道中的缓存任务
【发布时间】:2019-12-04 03:19:30
【问题描述】:

我正在尝试在 AzureDevops 发布管道中使用缓存任务,但出现以下错误:“无法找到管道缓存范围。”

完整的日志是:

2019-12-04T02:52:29.7320092Z ##[section]Starting: Cache Maven local repo
2019-12-04T02:52:29.7323359Z ==============================================================================
2019-12-04T02:52:29.7324096Z Task         : Cache
2019-12-04T02:52:29.7324205Z Description  : Cache files between runs
2019-12-04T02:52:29.7324288Z Version      : 2.0.0
2019-12-04T02:52:29.7324386Z Author       : Microsoft Corporation
2019-12-04T02:52:29.7324476Z Help         : https://aka.ms/pipeline-caching-docs
2019-12-04T02:52:29.7324596Z ==============================================================================
2019-12-04T02:52:30.1883169Z Resolving key:
2019-12-04T02:52:30.2148089Z  - maven      [string]
2019-12-04T02:52:30.2157501Z  - "Linux"    [string]
2019-12-04T02:52:30.3775363Z  - **/pom.xml [file pattern; matches: 1]
2019-12-04T02:52:30.3776471Z    - /home/vsts/work/r1/a/_GHQ_ABI_Salesforce_OneApp/AutomationTestsPrj/... --> 14132C0725424D58200724C825592A7666659E231F87619340789DA110453697
2019-12-04T02:52:30.3840201Z Resolved to: maven|"Linux"|eoJcSbaPKzXrAAmPNfX9NFnxcoydrNu9yrhaLikHrF8=
2019-12-04T02:52:30.3891079Z Resolving restore key:
2019-12-04T02:52:30.3891618Z  - maven   [string]
2019-12-04T02:52:30.3892061Z  - "Linux" [string]
2019-12-04T02:52:30.3892473Z Resolved to: maven|"Linux"|**
2019-12-04T02:52:30.3892596Z Resolving restore key:
2019-12-04T02:52:30.3892858Z  - maven [string]
2019-12-04T02:52:30.3892979Z Resolved to: maven|**
2019-12-04T02:52:31.7549257Z Information, ApplicationInsightsTelemetrySender will correlate events with X-TFS-Session 6a8d4cb9-7af8-4915-8dcc-46b9ded1e10b
2019-12-04T02:52:32.0675474Z Information, Getting a pipeline cache artifact with one of the following fingerprints:
2019-12-04T02:52:32.0676246Z Information, Fingerprint: `maven|"Linux"|eoJcSbaPKzXrAAmPNfX9NFnxcoydrNu9yrhaLikHrF8=`
2019-12-04T02:52:32.0676528Z Information, Fingerprint: `maven|"Linux"|**`
2019-12-04T02:52:32.0676755Z Information, Fingerprint: `maven|**`
2019-12-04T02:52:34.2400712Z Information, ApplicationInsightsTelemetrySender correlated 2 events with X-TFS-Session 6a8d4cb9-7af8-4915-8dcc-46b9ded1e10b
2019-12-04T02:52:34.2485748Z ##[error]Unable to find pipeline caching scopes.
2019-12-04T02:52:34.2528126Z ##[section]Finishing: Cache Maven local repo

我的配置是: Cache Configuration

哦,变量已创建,此任务在我执行 Maven 的任务之前: Cache Task order

那么,有人知道我在哪里失踪了吗?

【问题讨论】:

    标签: azure-devops azure-pipelines azure-pipelines-release-pipeline


    【解决方案1】:

    我知道在执行 Maven 之前应用这个Cache 步骤对于管道非常方便,例如减少整个执行时间。不幸的是,到目前为止,我们还没有提供 发布管道 支持的 Cache 任务:

    Pipeline caching


    解决方法:

    正如我上面提到的,Cache 任务非常方便,因为它可以帮助减少文件缓存中的时间浪费。

    因此,建议您将发布管道应用到 Multi-stage YAML 格式。虽然它正在运行一个发布阶段,但它的编译逻辑是在构建之后。

    查看此文档以转换您的管道:YAML schema

    【讨论】:

    • 大家好,谢谢你们的回答……我就是这么想的……
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-05-13
    • 2020-01-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-05
    • 1970-01-01
    相关资源
    最近更新 更多