---
version: 2
jobs:
  build:
    docker:
      - image: googleapis/git
    steps:
      - checkout
      - run:
          command: |
            if [ "$CIRCLE_BRANCH" == "master" ]; then
              git remote add private https://googleapis-publisher:${GITHUB_TOKEN}@github.com/googleapis/googleapis-private.git
              git push private HEAD:master
            fi
    working_directory: /var/code/googleapis/
  smoke-all:
    docker:
      - image: googleapis/artman:stable
    steps:
      - checkout
      - run:
          name: Run smoke tests
          command: |
            mkdir /tmp/reports
            export RUNNING_IN_ARTMAN_DOCKER=True
            smoketest_artman.py --root-dir=/var/code/googleapis/ --log=/tmp/reports/smoketest.log
      - store_test_results:
          path: /tmp/reports
      - store_artifacts:
          path: /tmp/reports
    working_directory: /var/code/googleapis/

workflows:
  version: 2
  smoketests:
    jobs:
      - smoke-all:
          filters:
            branches:
              only: master

---
version: 2
jobs:
  build:
    docker:
      - image: googleapis/git
    steps:
      - checkout
      - run:
          command: |
            if [ "$CIRCLE_BRANCH" == "master" ]; then
              git remote add private https://googleapis-publisher:${GITHUB_TOKEN}@github.com/googleapis/googleapis-private.git
              git push private HEAD:master
            fi
    working_directory: /var/code/googleapis/
  smoke-all:
    docker:
      - image: googleapis/artman:stable
    steps:
      - checkout
      - run:
          name: Run smoke tests
          command: |
            mkdir /tmp/reports
            export RUNNING_IN_ARTMAN_DOCKER=True
            smoketest_artman.py --root-dir=/var/code/googleapis/ --log=/tmp/reports/smoketest.log
      - store_test_results:
          path: /tmp/reports
      - store_artifacts:
          path: /tmp/reports
      - store_artifacts:
          path: /var/code/googleapis
    working_directory: /var/code/googleapis/

workflows:
  version: 2
  smoketests:
    jobs:
      - smoke-all:
          filters:
            branches:
              only: master

Store artifacts in CircleCI for files under /var/code/googleapis
Store artifacts in CircleCI for files under /var/code/googleapis
