From 75aebdd4639d8dfb59e1526bea68e4da3ad5e267 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Wed, 14 Jun 2017 15:44:06 -0700 Subject: [PATCH] Try out circleci workflow Signed-off-by: Daniel Nephin --- circle.yml | 52 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/circle.yml b/circle.yml index 3ba3f1d2fe..9e271b0a8c 100644 --- a/circle.yml +++ b/circle.yml @@ -1,14 +1,11 @@ version: 2 + jobs: - build: + + lint: working_directory: /work - docker: - - image: docker:17.05 - parallelism: 4 + docker: [{image: 'docker:17.05'}] steps: - - run: - name: "Install Git and SSH" - command: apk add -U git openssh - checkout - setup_remote_docker - run: @@ -16,40 +13,69 @@ jobs: - run: name: "Lint" command: | - if [ "$CIRCLE_NODE_INDEX" != "0" ]; then exit; fi dockerfile=dockerfiles/Dockerfile.lint echo "COPY . ." >> $dockerfile docker build -f $dockerfile --tag cli-linter . docker run cli-linter + + cross: + working_directory: /work + docker: [{image: 'docker:17.05'}] + steps: + - checkout + - setup_remote_docker - run: name: "Cross" command: | - if [ "$CIRCLE_NODE_INDEX" != "1" ]; then exit; fi dockerfile=dockerfiles/Dockerfile.cross echo "COPY . ." >> $dockerfile docker build -f $dockerfile --tag cli-builder . docker run --name cross cli-builder make cross docker cp cross:/go/src/github.com/docker/cli/build /work/build + - store_artifacts: + path: /work/build + + test: + working_directory: /work + docker: [{image: 'docker:17.05'}] + steps: + - checkout + - setup_remote_docker - run: name: "Unit Test with Coverage" command: | - if [ "$CIRCLE_NODE_INDEX" != "2" ]; then exit; fi dockerfile=dockerfiles/Dockerfile.dev echo "COPY . ." >> $dockerfile docker build -f $dockerfile --tag cli-builder . docker run --name test cli-builder make test-coverage + + - run: + name: "Upload to Codecov" + command: | docker cp test:/go/src/github.com/docker/cli/coverage.txt coverage.txt apk add -U bash curl curl -s https://codecov.io/bash | bash + + validate: + working_directory: /work + docker: [{image: 'docker:17.05'}] + steps: + - checkout + - setup_remote_docker - run: name: "Validate Vendor, Docs, and Code Generation" command: | - if [ "$CIRCLE_NODE_INDEX" != "3" ]; then exit; fi dockerfile=dockerfiles/Dockerfile.dev echo "COPY . ." >> $dockerfile rm -f .dockerignore # include .git docker build -f $dockerfile --tag cli-builder . docker run cli-builder make -B vendor compose-jsonschema manpages yamldocs - - store_artifacts: - path: /work/build +workflows: + version: 2 + ci: + jobs: + - lint + - cross + - test + - validate