CircleCI 配置错误 - 作业可能是对另一个作业的字符串引用
CircleCI config error - Job may be a string reference to another job
我不知道如何解决我的 CircleCI 配置文件中的错误。
config.yml
version: 2.1
executors:
node-executor:
docker:
- image: circleci/node:14.9.0
commands:
gatsby-build:
steps:
- checkout
- restore_cache:
keys:
- yarn-cache-{{ checksum "yarn.lock" }}
- run:
name: Install Dependencies
command: yarn install
- save_cache:
key: yarn-cache-{{ checksum "yarn.lock" }}
paths:
- ./node_modules
- run:
name: Gatsby Build
command: yarn build
workflows:
version: 2
build-deploy:
jobs:
- release:
filters:
branches:
only:
- master
jobs:
release:
executor: node-executor
working_directory: ~/tau-guide-website
steps:
- gatsby-build
- run:
name: Deploy
command: |
#upload all the code to machine
scp -r -o StrictHostKeyChecking=no ./ bitnami@1.1.6.5:~/stack/apps/test
当我尝试 运行 circleci config validate
时,我得到:
Error: ERROR IN CONFIG FILE:
[#/jobs/release] 0 subschemas matched instead of one
1. [#/jobs/release] only 1 subschema matches out of 2
| 1. [#/jobs/release/steps/1] 0 subschemas matched instead of one
| | 1. [#/jobs/release/steps/1] 3 schema violations found
| | | `when`/`unless` step
| | | 1. [#/jobs/release/steps/1] extraneous key [command] is not permitted
| | | | `when`/`unless` step
| | | | Permitted keys:
| | | | - when
| | | | - unless
| | | | Passed keys:
| | | | - run
| | | | - name
| | | | - command
| | | 2. [#/jobs/release/steps/1] extraneous key [name] is not permitted
| | | | `when`/`unless` step
| | | | Permitted keys:
| | | | - when
| | | | - unless
| | | | Passed keys:
| | | | - run
| | | | - name
| | | | - command
| | | 3. [#/jobs/release/steps/1] maximum size: [1], found: [2]
| | | | `when`/`unless` step
| | | | SCHEMA:
| | | | maxProperties: 1
| | | | INPUT:
| | | | run: null
| | | | name: Deploy
| | | | command: |
| | | | #upload all the code to machine
| | | | scp -r -o StrictHostKeyChecking=no ./ bitnami@1.1.6.5:~/stack/apps/test
| | 2. [#/jobs/release/steps/1] expected type: String, found: Mapping
| | | Shorthand commands, like `checkout`
| | | SCHEMA:
| | | type: string
| | | INPUT:
| | | run: null
| | | name: Deploy
| | | command: |
| | | #upload all the code to machine
| | | scp -r -o StrictHostKeyChecking=no ./ bitnami@1.1.6.5:~/stack/apps/test
| | 3. [#/jobs/release/steps/1] maximum size: [1], found: [2]
| | | long form commands like `run:`
| | | SCHEMA:
| | | maxProperties: 1
| | | INPUT:
| | | run: null
| | | name: Deploy
| | | command: |
| | | #upload all the code to machine
| | | scp -r -o StrictHostKeyChecking=no ./ bitnami@1.1.6.5:~/stack/apps/test
2. [#/jobs/release] expected type: String, found: Mapping
name: Deploy
command: |
我认为这些需要再缩进 1 级。 lessen/resolve 是错误吗?
我不知道如何解决我的 CircleCI 配置文件中的错误。
config.yml
version: 2.1
executors:
node-executor:
docker:
- image: circleci/node:14.9.0
commands:
gatsby-build:
steps:
- checkout
- restore_cache:
keys:
- yarn-cache-{{ checksum "yarn.lock" }}
- run:
name: Install Dependencies
command: yarn install
- save_cache:
key: yarn-cache-{{ checksum "yarn.lock" }}
paths:
- ./node_modules
- run:
name: Gatsby Build
command: yarn build
workflows:
version: 2
build-deploy:
jobs:
- release:
filters:
branches:
only:
- master
jobs:
release:
executor: node-executor
working_directory: ~/tau-guide-website
steps:
- gatsby-build
- run:
name: Deploy
command: |
#upload all the code to machine
scp -r -o StrictHostKeyChecking=no ./ bitnami@1.1.6.5:~/stack/apps/test
当我尝试 运行 circleci config validate
时,我得到:
Error: ERROR IN CONFIG FILE:
[#/jobs/release] 0 subschemas matched instead of one
1. [#/jobs/release] only 1 subschema matches out of 2
| 1. [#/jobs/release/steps/1] 0 subschemas matched instead of one
| | 1. [#/jobs/release/steps/1] 3 schema violations found
| | | `when`/`unless` step
| | | 1. [#/jobs/release/steps/1] extraneous key [command] is not permitted
| | | | `when`/`unless` step
| | | | Permitted keys:
| | | | - when
| | | | - unless
| | | | Passed keys:
| | | | - run
| | | | - name
| | | | - command
| | | 2. [#/jobs/release/steps/1] extraneous key [name] is not permitted
| | | | `when`/`unless` step
| | | | Permitted keys:
| | | | - when
| | | | - unless
| | | | Passed keys:
| | | | - run
| | | | - name
| | | | - command
| | | 3. [#/jobs/release/steps/1] maximum size: [1], found: [2]
| | | | `when`/`unless` step
| | | | SCHEMA:
| | | | maxProperties: 1
| | | | INPUT:
| | | | run: null
| | | | name: Deploy
| | | | command: |
| | | | #upload all the code to machine
| | | | scp -r -o StrictHostKeyChecking=no ./ bitnami@1.1.6.5:~/stack/apps/test
| | 2. [#/jobs/release/steps/1] expected type: String, found: Mapping
| | | Shorthand commands, like `checkout`
| | | SCHEMA:
| | | type: string
| | | INPUT:
| | | run: null
| | | name: Deploy
| | | command: |
| | | #upload all the code to machine
| | | scp -r -o StrictHostKeyChecking=no ./ bitnami@1.1.6.5:~/stack/apps/test
| | 3. [#/jobs/release/steps/1] maximum size: [1], found: [2]
| | | long form commands like `run:`
| | | SCHEMA:
| | | maxProperties: 1
| | | INPUT:
| | | run: null
| | | name: Deploy
| | | command: |
| | | #upload all the code to machine
| | | scp -r -o StrictHostKeyChecking=no ./ bitnami@1.1.6.5:~/stack/apps/test
2. [#/jobs/release] expected type: String, found: Mapping
name: Deploy
command: |
我认为这些需要再缩进 1 级。 lessen/resolve 是错误吗?