CircleCI配置:VSCode中缺少属性“ docker”

时间:2019-04-01 17:43:40

标签: circleci circleci-workflows

我有CircleCI工作流程,它已定义了执行程序和使用该执行程序的作业数量:

version: 2.1

executors:
  circleci-aws-build-agent:
    docker:
      - image: kagarlickij/circleci-aws-build-agent:latest
    working_directory: ~/project

jobs:
  checkout:
    executor: circleci-aws-build-agent
    steps:
      - checkout
      - persist_to_workspace:
          root: ~/
          paths:
            - project

  set_aws_config:
    executor: circleci-aws-build-agent
    steps:
      - attach_workspace:
          at: ~/
      - run:
          name: Set AWS credentials
          command: bash aws-configure.sh

它按预期工作,但在VSCode中我看到错误: enter image description here

任何想法如何解决?

2 个答案:

答案 0 :(得分:1)

VSCode使用的yml issue is with Schemastore没什么问题。

答案 1 :(得分:0)

这是因为您缺少docker块,该块定义了作业的默认容器映像。一个有效的块将是:

jobs:
  build:
    docker:
    - image: node:10
    steps:
    - checkout

如果您有多个使用同一图像的作业,则可以定义一个变量:

var_1: &job_defaults
  docker:
  - image: node:10

jobs:
  build:
    <<: *job_defaults
    steps:
    - checkout 
  deploy:
    <<: *job_defaults
    steps:
    - checkout

文档:https://circleci.com/docs/2.0/configuration-reference/#docker--machine--macosexecutor