Manual Approval Task does not seem to do anything


#1

Hello, I’ve splitted my build task into another to only deploy to production if approved.
I need to approve the second job as presented, but then nothing happens. The link to the job is not clickable and I cannot see a log anywhere, so I guess I am doing something wrong and nothing happens.

version: 2
jobs:
  build:
    docker:
      - image: docker:17.10.0-ce-git
    steps:
      - checkout
      - setup_remote_docker:
          version: 17.10.0-ce
      - run:
          name: Install pip & awscli
          command: |
            apk add --no-cache py-pip
            pip install awscli
      - run:
          name: Build application Docker image
          command: |
            docker build -t image .
  deploy_to_production:
    docker:
      - image: docker:17.10.0-ce-git
    steps:
      - run:
          name: Install pip & awscli
          command: |
            apk add --no-cache py-pip
            pip install awscli
      - deploy:
          name: Restart production services with new docker image
          command: |
            aws ecs register-task-definition --task-role-arn role --region eu-central-1 --cli-input-json file://deploy/cont-def.json
            aws ecs update-service --region eu-central-1 --cluster name --service service --task-definition taskdef
workflows:
  version: 2
  build_and_deploy_staging_production:
    jobs:
      - build:
          filters:
            branches:
              only: master
      - deploy_to_production:
          type: approval
          requires:
            - build
          filters:
            branches:
              only: master

#2

Found my mistake. I didn’t expect you need to have a special hold task, but that’s what you actually need. Correctly, the workflow part looks like the following:

workflows:
  version: 2
  build_and_deploy_staging_production:
    jobs:
      - build:
          filters:
            branches:
              only: master
      - hold:
          type: approval
          requires:
            - build
      - deploy_to_production:
          requires:
            - hold

#3