From f727213502d88f090dbe7add92e5ee717a1a2f89 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Wed, 3 Jan 2018 19:39:01 +0100 Subject: [PATCH] split up circleCI jobs into parrallel workflows --- .circleci/config.yml | 69 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 59 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 875c843f42..36293448d0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,13 +1,32 @@ version: 2 jobs: build: - working_directory: /home/circleci/.go_workspace/src/github.com/grafana/metrictank - machine: true + working_directory: /go/src/github.com/grafana/metrictank + docker: + - image: circleci/golang:1.9.2 + steps: + - checkout + - run: scripts/build.sh + - run: scripts/build_tools.sh + - setup_remote_docker + - run: scripts/build_docker.sh + - persist_to_workspace: + root: . + paths: build + + test: + working_directory: /go/src/github.com/grafana/metrictank + docker: + - image: circleci/golang:1.9.2 + steps: + - checkout + - run: go test -v -race $(go list ./... | grep -v github.com/grafana/metrictank/chaos) + + qa: + working_directory: /go/src/github.com/grafana/metrictank + docker: + - image: circleci/golang:1.9.2 steps: - - run: go version - - run: echo $GOPATH - - run: docker version - - run: docker-compose version - checkout - run: scripts/qa/gofmt.sh - run: scripts/qa/go-generate.sh @@ -17,12 +36,25 @@ jobs: - run: scripts/qa/unused.sh - run: scripts/qa/vendor.sh - run: go vet ./... - - run: scripts/build.sh - - run: scripts/build_tools.sh - - run: scripts/build_docker.sh + + qa-post-build: + working_directory: /home/circleci/.go_workspace/src/github.com/grafana/metrictank + machine: true + steps: + - checkout + - attach_workspace: + at: . - run: scripts/qa/docs.sh - - run: go test -v -race $(go list ./... | grep -v github.com/grafana/metrictank/chaos) - run: scripts/qa/end2end.sh + + deploy: + working_directory: /go/src/github.com/grafana/metrictank + docker: + - image: circleci/golang:1.9.2 + steps: + - checkout + - attach_workspace: + at: build - run: scripts/depends.sh - run: scripts/build_packages.sh - store_artifacts: @@ -36,3 +68,20 @@ jobs: docker login -u $DOCKER_USER -p $DOCKER_PASS scripts/push/docker.sh fi + +workflows: + version: 2 + build_accept_deploy: + jobs: + - build + - test + - qa + - qa-post-build: + requires: + - build + - deploy: + requires: + - build + - test + - qa + - qa-post-build