![](/img/trans.png)
[英]Getting 'A task is missing. The pipeline references a task called 'Cache'.' error in Azure Pipeline
[英]Unable to run Azure pipeline "A task is missing. The pipeline references a task called 'Cache'
我正在使用 azure_pipeline.yaml 配置设置 Github 项目的分支。 这似乎对社区中的其他人都很好,但是当我设置管道时,它给了我以下异常:
A task is missing. The pipeline references a task called 'Cache'. This usually indicates the task isn't installed, and you may be able to install it from the Marketplace: https://marketplace.visualstudio.com. (Task version 2, job 'compile_ci_build', step ''.)
A task is missing. The pipeline references a task called 'Cache'. This usually indicates the task isn't installed, and you may be able to install it from the Marketplace: https://marketplace.visualstudio.com. (Task version 2, job 'test_ci_build', step ''.)
A task is missing. The pipeline references a task called 'Cache'. This usually indicates the task isn't installed, and you may be able to install it from the Marketplace: https://marketplace.visualstudio.com. (Task version 2, job 'e2e_ci_build', step ''.)
具体来说,
这是我的Azure 管道链接
azure-pipeline.yml
tools/azure-pipelines/jobs-template.yml
参数化的tools/azure-pipelines/jobs-template.yml
[更新]
我修改了jobs-templates.yml并用Cache@2
注释掉了所有步骤,它运行良好。
按照设计,当你运行管道时,Azure DevOps 不会自动使所有任务可用。
您必须手动添加它们作为管道的一部分。
“缓存”就是这样一项任务。
我在经典 gui(非 yaml)模式下执行此操作,因为我发现搜索内容更容易但是您所做的是在管道中添加一个新任务并在任务搜索框中键入“缓存”。
这将调出任务。 单击添加以将其包含在管道中。
有关这方面的更多信息,我建议阅读:
https://docs.microsoft.com/en-us/azure/devops/pipelines/release/caching?view=azure-devops
最终能够使这个工作。
显然是我的 Azure 帐户。 我不允许使用Cache@2
。 更改所有行
- task: Cache@2
到
- task: CacheBeta@1
解决了我所有的问题。
我没有看到您从 git 存储库中在管道中添加了缓存任务。
它应该看起来像这里的例子:
variables:
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
steps:
- task: Cache@2
inputs:
key: 'yarn | "$(Agent.OS)" | yarn.lock'
restoreKeys: |
yarn | "$(Agent.OS)"
yarn
path: $(YARN_CACHE_FOLDER)
displayName: Cache Yarn packages
- script: yarn --frozen-lockfile
我遇到了同样的错误A task is missing. The pipeline references a..
A task is missing. The pipeline references a..
在PublishCucumberReport@1
一项 azure 任务中A task is missing. The pipeline references a..
我通过访问https://marketplace.visualstudio.com/
并转到任务然后单击get free
按钮来解决它,该按钮将其安装在您的管道上
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.