version: 2
jobs:
  build:
    machine: true
    working_directory: /home/circleci/logspout
    environment:
      DEBUG: true
    steps:
      - checkout
      - run: |
          make circleci
      - run: |
          make lint-ci
      - run: |
          make build
      - run: |
          make build-custom
      - run: |
          make -e test-image-size
      - run: |
          make -e test
      - run: |
          make -e test-tls
      - run: |
          make -e test-healthcheck
      - run: |
          make -e test-custom
      - run: |
          make -e test-tls-custom
      - store_artifacts:
          path: build
          destination: build
      - deploy:
          name: release
          command: |
            if [ "${CIRCLE_BRANCH}" == "release" ]; then
              make release
            fi
