Merge pull request #196 from dnephin/use-circleci-workflow

Use CircleCI workflows
This commit is contained in:
Vincent Demeester 2017-06-21 10:06:31 +02:00 committed by GitHub
commit 93562e94a9
1 changed files with 39 additions and 13 deletions

View File

@ -1,14 +1,11 @@
version: 2 version: 2
jobs: jobs:
build:
lint:
working_directory: /work working_directory: /work
docker: docker: [{image: 'docker:17.05'}]
- image: docker:17.05
parallelism: 4
steps: steps:
- run:
name: "Install Git and SSH"
command: apk add -U git openssh
- checkout - checkout
- setup_remote_docker - setup_remote_docker
- run: - run:
@ -16,40 +13,69 @@ jobs:
- run: - run:
name: "Lint" name: "Lint"
command: | command: |
if [ "$CIRCLE_NODE_INDEX" != "0" ]; then exit; fi
dockerfile=dockerfiles/Dockerfile.lint dockerfile=dockerfiles/Dockerfile.lint
echo "COPY . ." >> $dockerfile echo "COPY . ." >> $dockerfile
docker build -f $dockerfile --tag cli-linter . docker build -f $dockerfile --tag cli-linter .
docker run cli-linter docker run cli-linter
cross:
working_directory: /work
docker: [{image: 'docker:17.05'}]
steps:
- checkout
- setup_remote_docker
- run: - run:
name: "Cross" name: "Cross"
command: | command: |
if [ "$CIRCLE_NODE_INDEX" != "1" ]; then exit; fi
dockerfile=dockerfiles/Dockerfile.cross dockerfile=dockerfiles/Dockerfile.cross
echo "COPY . ." >> $dockerfile echo "COPY . ." >> $dockerfile
docker build -f $dockerfile --tag cli-builder . docker build -f $dockerfile --tag cli-builder .
docker run --name cross cli-builder make cross docker run --name cross cli-builder make cross
docker cp cross:/go/src/github.com/docker/cli/build /work/build 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: - run:
name: "Unit Test with Coverage" name: "Unit Test with Coverage"
command: | command: |
if [ "$CIRCLE_NODE_INDEX" != "2" ]; then exit; fi
dockerfile=dockerfiles/Dockerfile.dev dockerfile=dockerfiles/Dockerfile.dev
echo "COPY . ." >> $dockerfile echo "COPY . ." >> $dockerfile
docker build -f $dockerfile --tag cli-builder . docker build -f $dockerfile --tag cli-builder .
docker run --name test cli-builder make test-coverage 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 docker cp test:/go/src/github.com/docker/cli/coverage.txt coverage.txt
apk add -U bash curl apk add -U bash curl
curl -s https://codecov.io/bash | bash curl -s https://codecov.io/bash | bash
validate:
working_directory: /work
docker: [{image: 'docker:17.05'}]
steps:
- checkout
- setup_remote_docker
- run: - run:
name: "Validate Vendor, Docs, and Code Generation" name: "Validate Vendor, Docs, and Code Generation"
command: | command: |
if [ "$CIRCLE_NODE_INDEX" != "3" ]; then exit; fi
dockerfile=dockerfiles/Dockerfile.dev dockerfile=dockerfiles/Dockerfile.dev
echo "COPY . ." >> $dockerfile echo "COPY . ." >> $dockerfile
rm -f .dockerignore # include .git rm -f .dockerignore # include .git
docker build -f $dockerfile --tag cli-builder . docker build -f $dockerfile --tag cli-builder .
docker run cli-builder make -B vendor compose-jsonschema manpages yamldocs docker run cli-builder make -B vendor compose-jsonschema manpages yamldocs
- store_artifacts: workflows:
path: /work/build version: 2
ci:
jobs:
- lint
- cross
- test
- validate