version: 2
jobs:
  build:
    machine: true
    working_directory: ~/snowGlobe
    steps:
      - checkout
      - run:
          name: Pull tags
          command: /bin/bash -c "[[ ! -s \"$(git rev-parse --git-dir)/shallow\" ]] || git fetch --unshallow"

      - run:
          name: Unit Tests
          command: ./gradlew test

      - run:
          name: Integration Tests
          command: ./gradlew integrationTest

      - run:
          name: Build
          command: ./gradlew build

      - deploy:
          name: Publish Upstream Bounce Container
          command: |
            if [ "${CIRCLE_BRANCH}" == "master" ];
              docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
              docker push krogersnowglobe/upstream-bounce-app:latest
            fi

      - store_artifacts:
          path: build/reports/
          destination: reports
      - store_artifacts:
          path: build/libs
          destination: libs



version: 2
jobs:
  build:
    machine: true
    working_directory: ~/snowGlobe
    steps:
      - checkout
      - run:
          name: Pull tags
          command: /bin/bash -c "[[ ! -s \"$(git rev-parse --git-dir)/shallow\" ]] || git fetch --unshallow"

      - run:
          name: Unit Tests
          command: ./gradlew test

      - run:
          name: Integration Tests
          command: ./gradlew integrationTest

      - run:
          name: Build
          command: ./gradlew build

      - deploy:
          name: Publish Upstream Bounce Container
          command: |
            docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
            docker push krogersnowglobe/upstream-bounce-app:latest

      - store_artifacts:
          path: build/reports/
          destination: reports
      - store_artifacts:
          path: build/libs
          destination: libs



Revert "Moving docker image publish to only master"
Revert "Moving docker image publish to only master"

This reverts commit 480e19acfddb2ecf6476072e3070453379c58002.
