# CircleCI 2.0 configuration
version: 2
jobs:
  build:
    parallelism: 3
    docker:
      - image: nathanielc/docker-client
    working_directory: ~/kapacitor
    steps:
      - checkout
      - setup_remote_docker:
          reusable: true
      - run:
          name: Tests
          command: |
            ./circle-test.sh
      - deploy:
          name: Deploy Release Packages
          command: |
            if [[ "$CIRCLE_TAG" =~ v[0-9]+(\.[0-9]+){2}(-(rc|beta)[0-9]+)? ]]; then
              echo "Building/Publishing release packages for tag $CIRCLE_TAG"
              ./build.sh --debug --clean --generate --package --package-udfs --upload --bucket=dl.influxdata.com/kapacitor/releases --platform=all --arch=all --release
            fi


deployment:
  fake_deploy_for_cci2:
    tag: /v[0-9]+(\.[0-9]+){2}(-(rc|beta)[0-9]+)?/
    commands:
      # NOTE: this command doesn't actually get run, rather this simply triggers that the above deploy runs when a tag is pushed.
      # See https://discuss.circleci.com/t/git-tag-deploys-in-2-0/9493/6
      - echo "make tags run in 2.0"

# CircleCI 2.0 configuration
version: 2
jobs:
  build:
    parallelism: 3
    docker:
      - image: nathanielc/docker-client
    working_directory: ~/kapacitor
    steps:
      - checkout
      - setup_remote_docker:
          reusable: true
          docker_layer_caching: true
      - run:
          name: Tests
          command: |
            ./circle-test.sh
      - deploy:
          name: Deploy Release Packages
          command: |
            if [[ "$CIRCLE_TAG" =~ v[0-9]+(\.[0-9]+){2}(-(rc|beta)[0-9]+)? ]]; then
              echo "Building/Publishing release packages for tag $CIRCLE_TAG"
              ./build.sh --debug --clean --generate --package --package-udfs --upload --bucket=dl.influxdata.com/kapacitor/releases --platform=all --arch=all --release
            fi


deployment:
  fake_deploy_for_cci2:
    tag: /v[0-9]+(\.[0-9]+){2}(-(rc|beta)[0-9]+)?/
    commands:
      # NOTE: this command doesn't actually get run, rather this simply triggers that the above deploy runs when a tag is pushed.
      # See https://discuss.circleci.com/t/git-tag-deploys-in-2-0/9493/6
      - echo "make tags run in 2.0"

Enable docker layer caching in CircleCI
Enable docker layer caching in CircleCI