circleci 过滤器分支不起作用

circleci filter branch is not working

我是 circleci 的新手,我试图限制我的构建只在特定分支上工作,我尝试了下面的配置文件,但是当我包含过滤器部分时,我收到以下错误:

Your config file has errors and may not run correctly:
2 schema violations found
  required key [jobs] not found
  required key [version] not found

配置过滤器:

version: 2
jobs:
  provisioning_spark_installation_script:
    working_directory: ~/build_data
    docker:
      - image: circleci/python:3.6.6-stretch
    steps:
      - setup_remote_docker:
          docker_layer_caching: true
      - checkout
      - run: &install_awscli
               name: Install AWS CLI
               command: |
                 sudo pip3 install --upgrade awscli
      - run: &login_to_ecr
               name: Login to ECR
               command: aws ecr get-login --region us-east-1 | sed 's/-e none//g' | bash
workflows:
  version: 2
  deployments:
    jobs:
      - provisioning_spark_installation_script
        filters:
          branches:
            only: master

当我删除过滤器部分时,一切正常 - 但没有过滤器,我知道如何使用 shell 和 if else 解决方法,但它不太优雅。

有什么建议吗?

我只是在工作流名称后缺少冒号字符,此外还有更多的过滤器缩进。

所以现在我有以下配置:

version: 2
jobs:
  provisioning_spark_installation_script:
    working_directory: ~/build_data
    docker:
      - image: circleci/python:3.6.6-stretch
    steps:
      - setup_remote_docker:
          docker_layer_caching: true
      - checkout
      - run: &install_awscli
               name: Install AWS CLI
               command: |
                 sudo pip3 install --upgrade awscli
      - run: &login_to_ecr
               name: Login to ECR
               command: aws ecr get-login --region us-east-1 | sed 's/-e none//g' | bash
workflows:
  version: 2
  deployments:
    jobs:
      - provisioning_spark_installation_script:
          filters:
            branches:
              only: master