Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AzureDevOps - Cache Task in Release Pipeline

I'm trying to use the Cache task inside the AzureDevops release pipeline but I'm getting the following error: "Unable to find pipeline caching scopes."

The full log is:

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

And my configuration is: Cache Configuration

Oh, the variables are created and this task is before the task that I execute the Maven: Cache Task order

So, anybody got an idea of where I'm missing?

like image 514
João Heytor K. Pereira Avatar asked Feb 01 '26 18:02

João Heytor K. Pereira


1 Answers

I know applying this Cache step before your Maven execution is very convenient for pipeline, such as reducing the whole execution time. Just, unfortunately, until now, we haven't provide this Cache task supported in Release pipeline:

Release pipeline message

Pipeline caching


Work around:

As I mentioned above, Cache task is very convenient because it can help reduce the time waste in file caching.

So, suggest you apply your release pipeline into Multi-stage YAML format. Though it is running a release phase, but its compile logic is following build.

Check this doc to convert your pipeline: YAML schema.

like image 50
Mengdi Liang Avatar answered Feb 03 '26 09:02

Mengdi Liang



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!