From 4aa65d9833ab605daf04667f131ce3d92c9ff6bf Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Wed, 3 May 2017 20:55:52 -0400 Subject: [PATCH] Run steps in parallel. Signed-off-by: Daniel Nephin --- Makefile | 2 -- circle.yml | 24 +++++++++++++++++++----- dockerfiles/Dockerfile.ci | 2 -- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 4bdb0f6a86..8d5ddabee5 100644 --- a/Makefile +++ b/Makefile @@ -34,5 +34,3 @@ vendor: vendor.conf echo; git status --porcelain -- vendor 2>/dev/nul; \ echo; exit 1; \ fi; - -ci: cross test diff --git a/circle.yml b/circle.yml index 93dc842e3d..88f437eb66 100644 --- a/circle.yml +++ b/circle.yml @@ -1,27 +1,41 @@ version: 2 jobs: build: - working_directory: ~/cli + working_directory: /work docker: - image: docker:17.05 + parallelism: 4 steps: - run: name: "Install Git and SSH" - command: | - apk add -U git openssh + command: apk add -U git openssh - checkout - setup_remote_docker - run: name: "Lint" command: | + if [ "$CIRCLE_NODE_INDEX" != "0" ]; then exit; fi docker build -f dockerfiles/Dockerfile.lint --tag cli-linter . docker run cli-linter - run: - name: "Build and Unit Test" + name: "Cross" command: | + if [ "$CIRCLE_NODE_INDEX" != "1" ]; then exit; fi docker build -f dockerfiles/Dockerfile.ci --tag cli-builder . - docker run cli-builder + docker run --name cross cli-builder make cross + docker cp cross:/go/src/github.com/docker/cli/build /work/build + - run: + name: "Unit Test" + command: | + if [ "$CIRCLE_NODE_INDEX" != "2" ]; then exit; fi + docker build -f dockerfiles/Dockerfile.ci --tag cli-builder . + docker run cli-builder make test - run: name: "Vendor" command: | + if [ "$CIRCLE_NODE_INDEX" != "3" ]; then exit; fi + docker build -f dockerfiles/Dockerfile.ci --tag cli-builder . docker run cli-builder make vendor + + - store_artifacts: + path: /work/build diff --git a/dockerfiles/Dockerfile.ci b/dockerfiles/Dockerfile.ci index 0dd14ee192..d4185c9b22 100644 --- a/dockerfiles/Dockerfile.ci +++ b/dockerfiles/Dockerfile.ci @@ -23,5 +23,3 @@ COPY . /go/src/github.com/docker/cli ENV CGO_ENABLED=0 WORKDIR /go/src/github.com/docker/cli - -CMD ["make", "ci"]