---
version: 2

jobs:
  build:
    machine: true

    steps:
    - checkout
    - run: docker info
    - run: make
    - run: docker images

  build_master:
    machine: true

    steps:
    - checkout
    - run: docker info
    - run: make SUFFIX=
    - run: docker images
    - run: make tag SUFFIX=
    - run: docker login -u $QUAY_LOGIN -p $QUAY_PASSWORD quay.io
    - run: make push

  bump_version:
    docker:
    - image: circleci/golang
    steps:
    - checkout
    - run: ./scripts/bump_version.sh

workflows:
  version: 2
  prometheus:
    jobs:
    - build:
        filters:
          branches:
            ignore: master
    - build_master:
        filters:
          branches:
            only: master
  nightly:
    triggers:
      - schedule:
          cron: "0 6 * * *"
          filters:
            branches:
              only:
                - master
    jobs:
    - bump_version

---
version: 2

jobs:
  build:
    machine: true

    steps:
    - checkout
    - run: docker info
    - run: make
    - run: docker images

  build_master:
    machine: true

    steps:
    - checkout
    - run: docker info
    - run: make SUFFIX=
    - run: docker images
    - run: make tag SUFFIX=
    - run: docker login -u $QUAY_LOGIN -p $QUAY_PASSWORD quay.io
    - run: make push

  bump_version:
    docker:
    - image: circleci/golang
    steps:
    - checkout
    - run: ./scripts/bump_version.sh

workflows:
  version: 2
  prometheus:
    jobs:
    - build:
        filters:
          branches:
            ignore: master
    - build_master:
        context: org-context
        filters:
          branches:
            only: master
  nightly:
    triggers:
      - schedule:
          cron: "0 6 * * *"
          filters:
            branches:
              only:
                - master
    jobs:
    - bump_version:
        context: org-context

Use Circle CI's org context
Use Circle CI's org context

Signed-off-by: Simon Pasquier <38e2d22e48be18381a59028f88390cad04670376@redhat.com>
