version: 2.1
jobs:
  test:
    working_directory: ~/terraform-aws-ecs-service
    docker:
      - image: ruby:2.6.0
    steps:
      - checkout
      - run: ./scripts/ci/common/install-git-crypt.sh
      - run: ./scripts/ci/steps/test.sh
  prerelease:
    working_directory: ~/terraform-aws-ecs-service
    docker:
      - image: ruby:2.6.0
    steps:
      - checkout
      - run: ./scripts/ci/common/install-git-crypt.sh
      - run: ./scripts/ci/steps/prerelease.sh
  release:
    working_directory: ~/terraform-aws-ecs-service
    docker:
      - image: ruby:2.6.0
    steps:
      - checkout
      - run: ./scripts/ci/common/install-git-crypt.sh
      - run: ./scripts/ci/steps/release.sh
workflows:
  version: 2
  pipeline:
    jobs:
      - test:
          filters:
            branches:
              only:
                - main
                - /^dependabot.*/
      - prerelease:
          requires:
            - test
          filters:
            branches:
              only: main
      - hold:
          type: approval
          requires:
            - prerelease
          filters:
            branches:
              only: main
      - release:
          requires:
            - hold
          filters:
            branches:
              only: main

version: 2.1
jobs:
  test:
    working_directory: ~/terraform-aws-ecs-service
    docker:
      - image: ruby:2.6.0
    steps:
      - checkout
      - run: ./scripts/ci/common/install-git-crypt.sh
      - run: ./scripts/ci/steps/test.sh
  prerelease:
    working_directory: ~/terraform-aws-ecs-service
    docker:
      - image: ruby:2.6.0
    steps:
      - checkout
      - run: ./scripts/ci/common/install-git-crypt.sh
      - run: ./scripts/ci/steps/prerelease.sh
  release:
    working_directory: ~/terraform-aws-ecs-service
    docker:
      - image: ruby:2.6.0
    steps:
      - checkout
      - run: ./scripts/ci/common/install-git-crypt.sh
      - run: ./scripts/ci/steps/release.sh
workflows:
  version: 2
  pipeline:
    jobs:
      - test:
          filters:
            branches:
              only: main
      - prerelease:
          requires:
            - test
          filters:
            branches:
              only: main
      - hold:
          type: approval
          requires:
            - prerelease
          filters:
            branches:
              only: main
      - release:
          requires:
            - hold
          filters:
            branches:
              only: main

Disable branch tests for now
Disable branch tests for now [skip ci]
