CircleCI:我的配置文件出错-"expected type: String, found: Mapping"

CircleCI: getting errors my config file-"expected type: String, found: Mapping"

我正在尝试创建 CircleCI 管道,但不断收到此错误:

#!/bin/sh -eo pipefail
# ERROR IN CONFIG FILE:
# [#/jobs/build] 0 subschemas matched instead of one
# 1. [#/jobs/build] only 1 subschema matches out of 2
# |   1. [#/jobs/build] no subschema matched out of the total 2 subschemas
# |   |   1. [#/jobs/build] 0 subschemas matched instead of one
# |   |   |   1. [#/jobs/build] required key [docker] not found
# |   |   |   2. [#/jobs/build] required key [machine] not found
# |   |   |   3. [#/jobs/build] required key [macos] not found
# |   |   2. [#/jobs/build] required key [executor] not found
# |   |   |   A job must have one of `docker`, `machine`, `macos` or `executor` (which can provide docker/machine/macos information).
# 2. [#/jobs/build] expected type: String, found: Mapping
# |   Job may be a string reference to another job
# 
# -------
# Warning: This configuration was auto-generated to show you the message above.
# Don't rerun this job. Rerunning will have no effect.
false

我的config.yaml

version: 2.1
workflows:
  version: 2
  testing-workflow:
    jobs:
      - build:
          context: testing
          filters:
            branches:
              only: 
                - develop
jobs:
  build:
    steps:
      - aws-ecr/build-and-push-image:
          account-url: AWS_ECR_ACCOUNT_URL
          create-repo: false
          dockerfile: Dockerfile
          region: AWS_DEFAULT_REGION
          repo: $AWS_ECR_REPO_NAME
          tag: "latest,$(git rev-parse HEAD)"
orbs:
  slack: circleci/slack@3.4.2
  kubernetes: circleci/kubernetes@0.11.0
  aws-eks: circleci/aws-eks@0.2.7
  helm: circleci/helm@0.2.3
  aws-ecr: circleci/aws-ecr@6.8.2

不确定为什么会出现此错误,但我希望这不是缩进错误。

据我所知,在定义作业时,您需要定义它是否在 specific docker 图像中 运行,在 macos 机器中,windows 机器或普通 ci 机器

https://circleci.com/docs/2.0/configuration-reference/?section=reference#docker-machine-macos-windows-executor

看来你想做普通机,所以你需要做

version: 2.1
workflows:
  version: 2
  testing-workflow:
    jobs:
      - build:
          context: testing
          filters:
            branches:
              only: 
                - develop
jobs:
  build:
    machine: true
    steps:
      - aws-ecr/build-and-push-image:
          account-url: AWS_ECR_ACCOUNT_URL
          create-repo: false
          dockerfile: Dockerfile
          region: AWS_DEFAULT_REGION
          repo: $AWS_ECR_REPO_NAME
          tag: "latest,$(git rev-parse HEAD)"
orbs:
  slack: circleci/slack@3.4.2
  kubernetes: circleci/kubernetes@0.11.0
  aws-eks: circleci/aws-eks@0.2.7
  helm: circleci/helm@0.2.3
  aws-ecr: circleci/aws-ecr@6.8.2