github.com/AliyunContainerService/cli@v0.0.0-20181009023821-814ced4b30d0/circle.yml (about) 1 version: 2 2 3 jobs: 4 5 lint: 6 working_directory: /work 7 docker: [{image: 'docker:18.03-git'}] 8 steps: 9 - checkout 10 - setup_remote_docker: 11 version: 18.03.1-ce 12 reusable: true 13 exclusive: false 14 - run: 15 command: docker version 16 - run: 17 name: "Lint" 18 command: | 19 dockerfile=dockerfiles/Dockerfile.lint 20 echo "COPY . ." >> $dockerfile 21 docker build -f $dockerfile --tag cli-linter:$CIRCLE_BUILD_NUM . 22 docker run --rm cli-linter:$CIRCLE_BUILD_NUM 23 24 cross: 25 working_directory: /work 26 docker: [{image: 'docker:18.03-git'}] 27 parallelism: 3 28 steps: 29 - checkout 30 - setup_remote_docker: 31 version: 18.03.1-ce 32 reusable: true 33 exclusive: false 34 - run: 35 name: "Cross" 36 command: | 37 dockerfile=dockerfiles/Dockerfile.cross 38 echo "COPY . ." >> $dockerfile 39 docker build -f $dockerfile --tag cli-builder:$CIRCLE_BUILD_NUM . 40 name=cross-$CIRCLE_BUILD_NUM-$CIRCLE_NODE_INDEX 41 docker run \ 42 -e CROSS_GROUP=$CIRCLE_NODE_INDEX \ 43 --name $name cli-builder:$CIRCLE_BUILD_NUM \ 44 make cross 45 docker cp \ 46 $name:/go/src/github.com/docker/cli/build \ 47 /work/build 48 - store_artifacts: 49 path: /work/build 50 51 test: 52 working_directory: /work 53 docker: [{image: 'docker:18.03-git'}] 54 steps: 55 - checkout 56 - setup_remote_docker: 57 version: 18.03.1-ce 58 reusable: true 59 exclusive: false 60 - run: 61 name: "Unit Test with Coverage" 62 command: | 63 dockerfile=dockerfiles/Dockerfile.dev 64 echo "COPY . ." >> $dockerfile 65 docker build -f $dockerfile --tag cli-builder:$CIRCLE_BUILD_NUM . 66 docker run --name \ 67 test-$CIRCLE_BUILD_NUM cli-builder:$CIRCLE_BUILD_NUM \ 68 make test-coverage 69 70 - run: 71 name: "Upload to Codecov" 72 command: | 73 docker cp \ 74 test-$CIRCLE_BUILD_NUM:/go/src/github.com/docker/cli/coverage.txt \ 75 coverage.txt 76 apk add -U bash curl 77 curl -s https://codecov.io/bash | bash || \ 78 echo 'Codecov failed to upload' 79 80 validate: 81 working_directory: /work 82 docker: [{image: 'docker:18.03-git'}] 83 steps: 84 - checkout 85 - setup_remote_docker: 86 version: 18.03.1-ce 87 reusable: true 88 exclusive: false 89 - run: 90 name: "Validate Vendor, Docs, and Code Generation" 91 command: | 92 dockerfile=dockerfiles/Dockerfile.dev 93 echo "COPY . ." >> $dockerfile 94 rm -f .dockerignore # include .git 95 docker build -f $dockerfile --tag cli-builder-with-git:$CIRCLE_BUILD_NUM . 96 docker run --rm cli-builder-with-git:$CIRCLE_BUILD_NUM \ 97 make ci-validate 98 shellcheck: 99 working_directory: /work 100 docker: [{image: 'docker:18.03-git'}] 101 steps: 102 - checkout 103 - setup_remote_docker: 104 version: 18.03.1-ce 105 reusable: true 106 exclusive: false 107 - run: 108 name: "Run shellcheck" 109 command: | 110 dockerfile=dockerfiles/Dockerfile.shellcheck 111 echo "COPY . ." >> $dockerfile 112 docker build -f $dockerfile --tag cli-validator:$CIRCLE_BUILD_NUM . 113 docker run --rm cli-validator:$CIRCLE_BUILD_NUM \ 114 make shellcheck 115 workflows: 116 version: 2 117 ci: 118 jobs: 119 - lint 120 - cross 121 - test 122 - validate 123 - shellcheck