CircleCI:我的配置文件"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

我的配置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

不知道为什么我会得到这个错误,但我希望它不应该是一些缩进错误。

据我所知,在定义作业时,您需要定义它是在特定的docker映像中运行,还是在macos机器、windows机器或常规ci机器中运行

https://circleci.com/docs/2.0/configuration-reference/?section=reference#docker-机器macos窗口执行程序

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

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

相关内容

最新更新