Merge pull request #2009 from thaJeztah/ci_buildkit

CircleCI/Jenkins: use buildkit
This commit is contained in:
Sebastiaan van Stijn 2019-08-12 11:45:43 +02:00 committed by GitHub
commit f807b5ef83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 7 deletions

View File

@ -1,2 +1,6 @@
.dockerignore
.git .git
.gitignore
appveyor.yml
build build
circle.yml

3
Jenkinsfile vendored
View File

@ -5,8 +5,9 @@ wrappedNode(label: 'linux && x86_64', cleanWorkspace: true) {
stage "Run end-to-end test suite" stage "Run end-to-end test suite"
sh "docker version" sh "docker version"
sh "docker info"
sh "E2E_UNIQUE_ID=clie2e${BUILD_NUMBER} \ sh "E2E_UNIQUE_ID=clie2e${BUILD_NUMBER} \
IMAGE_TAG=clie2e${BUILD_NUMBER} \ IMAGE_TAG=clie2e${BUILD_NUMBER} \
make -f docker.Makefile test-e2e" DOCKER_BUILDKIT=1 make -f docker.Makefile test-e2e"
} }
} }

View File

@ -5,6 +5,8 @@ jobs:
lint: lint:
working_directory: /work working_directory: /work
docker: [{image: 'docker:18.09-git'}] docker: [{image: 'docker:18.09-git'}]
environment:
DOCKER_BUILDKIT: 1
steps: steps:
- checkout - checkout
- setup_remote_docker: - setup_remote_docker:
@ -16,12 +18,14 @@ jobs:
- run: - run:
name: "Lint" name: "Lint"
command: | command: |
docker build -f dockerfiles/Dockerfile.lint --tag cli-linter:$CIRCLE_BUILD_NUM . docker build --progress=plain -f dockerfiles/Dockerfile.lint --tag cli-linter:$CIRCLE_BUILD_NUM .
docker run --rm cli-linter:$CIRCLE_BUILD_NUM docker run --rm cli-linter:$CIRCLE_BUILD_NUM
cross: cross:
working_directory: /work working_directory: /work
docker: [{image: 'docker:18.09-git'}] docker: [{image: 'docker:18.09-git'}]
environment:
DOCKER_BUILDKIT: 1
parallelism: 3 parallelism: 3
steps: steps:
- checkout - checkout
@ -32,7 +36,7 @@ jobs:
- run: - run:
name: "Cross" name: "Cross"
command: | command: |
docker build -f dockerfiles/Dockerfile.cross --tag cli-builder:$CIRCLE_BUILD_NUM . docker build --progress=plain -f dockerfiles/Dockerfile.cross --tag cli-builder:$CIRCLE_BUILD_NUM .
name=cross-$CIRCLE_BUILD_NUM-$CIRCLE_NODE_INDEX name=cross-$CIRCLE_BUILD_NUM-$CIRCLE_NODE_INDEX
docker run \ docker run \
-e CROSS_GROUP=$CIRCLE_NODE_INDEX \ -e CROSS_GROUP=$CIRCLE_NODE_INDEX \
@ -47,6 +51,8 @@ jobs:
test: test:
working_directory: /work working_directory: /work
docker: [{image: 'docker:18.09-git'}] docker: [{image: 'docker:18.09-git'}]
environment:
DOCKER_BUILDKIT: 1
steps: steps:
- checkout - checkout
- setup_remote_docker: - setup_remote_docker:
@ -57,7 +63,7 @@ jobs:
name: "Unit Test with Coverage" name: "Unit Test with Coverage"
command: | command: |
mkdir -p test-results/unit-tests mkdir -p test-results/unit-tests
docker build -f dockerfiles/Dockerfile.dev --tag cli-builder:$CIRCLE_BUILD_NUM . docker build --progress=plain -f dockerfiles/Dockerfile.dev --tag cli-builder:$CIRCLE_BUILD_NUM .
docker run \ docker run \
-e GOTESTSUM_JUNITFILE=/tmp/junit.xml \ -e GOTESTSUM_JUNITFILE=/tmp/junit.xml \
--name \ --name \
@ -83,6 +89,8 @@ jobs:
validate: validate:
working_directory: /work working_directory: /work
docker: [{image: 'docker:18.09-git'}] docker: [{image: 'docker:18.09-git'}]
environment:
DOCKER_BUILDKIT: 1
steps: steps:
- checkout - checkout
- setup_remote_docker: - setup_remote_docker:
@ -93,13 +101,15 @@ jobs:
name: "Validate Vendor, Docs, and Code Generation" name: "Validate Vendor, Docs, and Code Generation"
command: | command: |
rm -f .dockerignore # include .git rm -f .dockerignore # include .git
docker build -f dockerfiles/Dockerfile.dev --tag cli-builder-with-git:$CIRCLE_BUILD_NUM . docker build --progress=plain -f dockerfiles/Dockerfile.dev --tag cli-builder-with-git:$CIRCLE_BUILD_NUM .
docker run --rm cli-builder-with-git:$CIRCLE_BUILD_NUM \ docker run --rm cli-builder-with-git:$CIRCLE_BUILD_NUM \
make ci-validate make ci-validate
no_output_timeout: 15m no_output_timeout: 15m
shellcheck: shellcheck:
working_directory: /work working_directory: /work
docker: [{image: 'docker:18.09-git'}] docker: [{image: 'docker:18.09-git'}]
environment:
DOCKER_BUILDKIT: 1
steps: steps:
- checkout - checkout
- setup_remote_docker: - setup_remote_docker:
@ -109,7 +119,7 @@ jobs:
- run: - run:
name: "Run shellcheck" name: "Run shellcheck"
command: | command: |
docker build -f dockerfiles/Dockerfile.shellcheck --tag cli-validator:$CIRCLE_BUILD_NUM . docker build --progress=plain -f dockerfiles/Dockerfile.shellcheck --tag cli-validator:$CIRCLE_BUILD_NUM .
docker run --rm cli-validator:$CIRCLE_BUILD_NUM \ docker run --rm cli-validator:$CIRCLE_BUILD_NUM \
make shellcheck make shellcheck
workflows: workflows: