# Golang CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-go/ for more details
version: 2
jobs:
  build:
    docker:
      # specify the version
      - image: circleci/golang:1.9

      # Specify service dependencies here if necessary
      # CircleCI maintains a library of pre-built images
      # documented at https://circleci.com/docs/2.0/circleci-images/
      # - image: circleci/postgres:9.4

    #### TEMPLATE_NOTE: go expects specific checkout path representing url
    #### expecting it in the form of
    ####   /go/src/github.com/circleci/go-tool
    ####   /go/src/bitbucket.org/circleci/go-tool
    working_directory: /go/src/github.com/{{ORG_NAME}}/{{REPO_NAME}}
    steps:
      - checkout

      # specify any bash command here prefixed with `run: `
      - run: go get -v -t -d ./...
      - run: go test -v ./...

# Golang CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-go/ for more details
version: 2
workflows:
  version: 2
  merge-to-master:
    jobs:
      - tester
      - update_tag:
          requires:
            - tester
          filters:
            branches:
              only: /master/
jobs:
  update_tag:
    docker:
      - image: circleci/golang:1.9
    working_directory: /go/src/github.com/go-chef/chefi
    steps:
      - add_ssh_keys:
          fingerprints:
            - 35:45:41:ba:cf:3f:7f:d5:00:0f:11:6b:4d:c0:a1:90
      - checkout
      - run: curl -s https://api.github.com/repos/pantheon-systems/autotag/releases/latest | grep browser_download | grep Linux | cut -d '"' -f 4 | xargs curl -o ./autotag -L && chmod 755 ./autotag
      - run: ./autotag
      - run: git push --tags origin
  tester:
    docker:
      - image: circleci/golang:1.9
      #### TEMPLATE_NOTE: go expects specific checkout path representing url
      #### expecting it in the form of
      ####   /go/src/github.com/circleci/go-tool
      ####   /go/src/bitbucket.org/circleci/go-tool
    working_directory: /go/src/github.com/go-chef/chef
    steps:
      - add_ssh_keys:
          fingerprints:
            - 35:45:41:ba:cf:3f:7f:d5:00:0f:11:6b:4d:c0:a1:90
      - checkout
      # specify any bash command here prefixed with `run: `
      - run: env
      - run: ls && pwd

Update the tag for the release as it is merged to master Use the autotag code
Update the tag for the release as it is merged to master
Use the autotag code
