我目前正在尝试使用commands
CircleCI 2.1 版中可用的功能,以便我可以重用一些常用命令。我正在使用 CLI 命令进行测试:
circleci config process ./.circleci/config.latest.yaml > ./.circleci/config.yml
Run Code Online (Sandbox Code Playgroud)
但我收到以下错误:
Error: Error calling workflow: 'main'
Error calling job: 'build'
Error calling command: 'build_source'
Cannot find a definition for command named restore-cache
Run Code Online (Sandbox Code Playgroud)
似乎restore-cache
在直接版本 2 配置文件中工作得很好,但是当我尝试使用process
它处理 2.1 文件时,它会大惊小怪。
以下是我的config.yaml
文件的编辑版本,希望能有所帮助。如果有任何有用的其他信息,请告诉我。
version: 2.1
defaults: &defaults
/**
* Unimportant stuff
*/
aliases:
- &restore-root-cache
keys:
- v1-deps-{{ .Branch }}-{{ checksum "package.json" }}
- v1-deps-{{ .Branch }}
- v1-deps
commands:
build_source:
description: 'Installs dependencies, then builds …
Run Code Online (Sandbox Code Playgroud) continuous-integration circleci circleci-workflows circleci-2.0