version: 2
jobs:
  build:
    docker:
      - image: circleci/golang:1.12.5
        environment:
          GO111MODULE: "on"

    working_directory: /go/src/github.com/xridge/kubestone
    steps:
      - checkout

      # Unit test
      - run:
          name: Install kubebuilder
          command: |
            version=2.0.0-beta.0
            arch=amd64
            curl -L -O https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${version}/kubebuilder_${version}_linux_${arch}.tar.gz
            tar -zxvf kubebuilder_${version}_linux_${arch}.tar.gz
            sudo mv kubebuilder_${version}_linux_${arch} /usr/local/kubebuilder
            export PATH=$PATH:/usr/local/kubebuilder/bin
      - run: make test

      # End-to-end test
      - run: ./tests/e2e/e2e-test-in-kind.sh

version: 2
jobs:
  run_unit_tests:
    docker:
      - image: circleci/golang:1.12.5
        environment:
          GO111MODULE: "on"

    working_directory: /go/src/github.com/xridge/kubestone
    steps:
      - checkout
      - run:
          name: Install kubebuilder
          command: |
            version=2.0.0-beta.0
            arch=amd64
            curl -L -O https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${version}/kubebuilder_${version}_linux_${arch}.tar.gz
            tar -zxvf kubebuilder_${version}_linux_${arch}.tar.gz
            sudo mv kubebuilder_${version}_linux_${arch} /usr/local/kubebuilder
            export PATH=$PATH:/usr/local/kubebuilder/bin
      - run: make test

  run_e2e_tests:
    machine:
      image: ubuntu-1604:201903-01
      docker_layer_caching: true

    working_directory: /go/src/github.com/xridge/kubestone
    steps:
      - checkout
      - setup_remote_docker
      - run:
          name: Start e2e test
          command: |
            ./tests/e2e/e2e-test-in-kind.sh
Use machine for e2e test
FIX: Use machine for e2e test
