# Golang CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-go/ for more details
version: 2
jobs:
  build:
    docker:
      - image: circleci/golang:1.10
      - image: vault:0.10.2
        environment:
            SKIP_SETCAP: true
            VAULT_DEV_ROOT_TOKEN_ID: 227e1cce-6bf7-30bb-2d2a-acc854318caf

    working_directory: /go/src/github.com/banzaicloud/bank-vaults
    steps:
      - checkout
      - run:
          name: Run dep ensure
          command: |
              curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
              dep ensure
      - run:
          name: Build Bank Vaults
          command:
              make build
      - run:
          name: Run verification
          command:
              make verify
          environment:
            VAULT_ADDR: http://localhost:8200
            VAULT_TOKEN: 227e1cce-6bf7-30bb-2d2a-acc854318caf
      - run:
          name: Install Operator SDK
          command:
              go get github.com/operator-framework/operator-sdk/commands/operator-sdk
      - setup_remote_docker
      - run:
          name: Build Vault Operator
          command: |
              cd operator
              operator-sdk build banzaicloud/vault-operator

# Golang CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-go/ for more details
version: 2
jobs:
  build:
    docker:
      - image: circleci/golang:1.10
      - image: vault:0.10.2
        environment:
            SKIP_SETCAP: true
            VAULT_DEV_ROOT_TOKEN_ID: 227e1cce-6bf7-30bb-2d2a-acc854318caf

    working_directory: /go/src/github.com/banzaicloud/bank-vaults
    steps:
      - checkout
      - run:
          name: Run dep ensure
          command: |
              curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
              dep ensure -v
      - run:
          name: Unwind vendor
          command: |
              rm -rf vendor/
              git reset --hard
      - run:
          name: Build Bank Vaults
          command:
              make build
      - run:
          name: Run verification
          command:
              make verify
          environment:
            VAULT_ADDR: http://localhost:8200
            VAULT_TOKEN: 227e1cce-6bf7-30bb-2d2a-acc854318caf
      - run:
          name: Install Operator SDK
          command:
              go get github.com/operator-framework/operator-sdk/commands/operator-sdk
      - setup_remote_docker
      - run:
          name: Build Vault Operator
          command: |
              cd operator
              operator-sdk build banzaicloud/vault-operator

Add unwind vendor build step here as well
Add unwind vendor build step here as well
