Fully dogfood Code Quality by removing homemade docker-in-docker extension
What does this Merge Request do and why?
Fully dogfoods GitLab Code Quality by removing the homemade .docker:use-docker-in-docker
extension from Code Quality job on CI as builtin Jobs/Code-Quality.gitlab-ci.yml
already has docker-in-docker definition in it.
The residue introduced in !370 (merged) and !458 (merged) was from !1270 (merged).
diff
@@ -1,20 +1,16 @@
code_quality:
+ stage: test
image: docker:20.10.12
+ allow_failure: true
services:
- name: docker:20.10.12-dind
command:
- "--tls=false"
- "--host=tcp://0.0.0.0:2375"
variables:
- DOCKER_VERSION: 20.10.16
- DOCKER_HOST: tcp://docker:2375
- DOCKER_TLS_CERTDIR: ''
DOCKER_DRIVER: overlay2
+ DOCKER_TLS_CERTDIR: ''
CODE_QUALITY_IMAGE: registry.gitlab.com/gitlab-org/ci-cd/codequality:0.85.26
- tags:
- - gitlab-org-docker
- stage: test
- allow_failure: true
needs: []
script:
- export SOURCE_CODE=$PWD
@@ -75,6 +71,6 @@
- Vagrantfile
- gitlab-openldap/**/*
- vagrant/assets/**/*
- extends:
- - ".docker:use-docker-in-docker"
+ tags:
+ - gitlab-org-docker
before
https://gitlab.com/gitlab-org/gitlab-development-kit/-/ci/editor?branch_name=main&tab=3
code_quality:
image: docker:20.10.12
services:
- name: docker:20.10.12-dind
command:
- "--tls=false"
- "--host=tcp://0.0.0.0:2375"
variables:
DOCKER_VERSION: 20.10.16
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ''
DOCKER_DRIVER: overlay2
CODE_QUALITY_IMAGE: registry.gitlab.com/gitlab-org/ci-cd/codequality:0.85.26
tags:
- gitlab-org-docker
stage: test
allow_failure: true
needs: []
script:
- export SOURCE_CODE=$PWD
- |
if ! docker info &>/dev/null; then
if [ -z "$DOCKER_HOST" ] && [ -n "$KUBERNETES_PORT" ]; then
export DOCKER_HOST='tcp://localhost:2375'
fi
fi
- |
function propagate_env_vars() {
CURRENT_ENV=$(printenv)
for VAR_NAME; do
echo $CURRENT_ENV | grep "${VAR_NAME}=" > /dev/null && echo "--env $VAR_NAME "
done
}
- docker pull --quiet "$CODE_QUALITY_IMAGE"
- |
docker run --rm \
$(propagate_env_vars \
SOURCE_CODE \
TIMEOUT_SECONDS \
CODECLIMATE_DEBUG \
CODECLIMATE_DEV \
REPORT_STDOUT \
REPORT_FORMAT \
ENGINE_MEMORY_LIMIT_BYTES \
CODECLIMATE_PREFIX \
) \
--volume "$PWD":/code \
--volume /var/run/docker.sock:/var/run/docker.sock \
"$CODE_QUALITY_IMAGE" /code
artifacts:
reports:
codequality:
- gl-code-quality-report.json
expire_in: 1 week
dependencies: []
rules:
- changes:
- "**/*.{rb,erb,sh,yml,example,types}"
- "{lib,gem,bin}/**/*"
- "{spec,support}/**/*"
- ".tool-versions"
- ".gdkrc"
- bin/gdk-shell
- ".gitlab-ci.yml"
- ".gitlab/ci/**/*"
- Gemfile{,.lock}
- Brewfile
- Makefile
- Rakefile
- Dockerfile
- "**/*/Dockerfile"
- packages*.txt
- "**/*/Makefile"
- Vagrantfile
- gitlab-openldap/**/*
- vagrant/assets/**/*
extends:
- ".docker:use-docker-in-docker"
after
code_quality:
stage: test
image: docker:20.10.12
allow_failure: true
services:
- name: docker:20.10.12-dind
command:
- "--tls=false"
- "--host=tcp://0.0.0.0:2375"
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ''
CODE_QUALITY_IMAGE: registry.gitlab.com/gitlab-org/ci-cd/codequality:0.85.26
needs: []
script:
- export SOURCE_CODE=$PWD
- |
if ! docker info &>/dev/null; then
if [ -z "$DOCKER_HOST" ] && [ -n "$KUBERNETES_PORT" ]; then
export DOCKER_HOST='tcp://localhost:2375'
fi
fi
- |
function propagate_env_vars() {
CURRENT_ENV=$(printenv)
for VAR_NAME; do
echo $CURRENT_ENV | grep "${VAR_NAME}=" > /dev/null && echo "--env $VAR_NAME "
done
}
- docker pull --quiet "$CODE_QUALITY_IMAGE"
- |
docker run --rm \
$(propagate_env_vars \
SOURCE_CODE \
TIMEOUT_SECONDS \
CODECLIMATE_DEBUG \
CODECLIMATE_DEV \
REPORT_STDOUT \
REPORT_FORMAT \
ENGINE_MEMORY_LIMIT_BYTES \
CODECLIMATE_PREFIX \
) \
--volume "$PWD":/code \
--volume /var/run/docker.sock:/var/run/docker.sock \
"$CODE_QUALITY_IMAGE" /code
artifacts:
reports:
codequality:
- gl-code-quality-report.json
expire_in: 1 week
dependencies: []
rules:
- changes:
- "**/*.{rb,erb,sh,yml,example,types}"
- "{lib,gem,bin}/**/*"
- "{spec,support}/**/*"
- ".tool-versions"
- ".gdkrc"
- bin/gdk-shell
- ".gitlab-ci.yml"
- ".gitlab/ci/**/*"
- Gemfile{,.lock}
- Brewfile
- Makefile
- Rakefile
- Dockerfile
- "**/*/Dockerfile"
- packages*.txt
- "**/*/Makefile"
- Vagrantfile
- gitlab-openldap/**/*
- vagrant/assets/**/*
tags:
- gitlab-org-docker
Follows up !1270 (merged)
Updates !2038 (merged) (, !2036 (merged)), and !1229 (merged)
Merge Request checklist
-
This change is backward compatible. If not, please include steps to communicate to our users. - [n/a] Tests added for new functionality. If not, please raise Issue to follow-up.
- [n/a] Documentation added/updated, if needed.
- [n/a]
gdk doctor
test added, if needed. - [n/a] Add the
~highlight
label if this MR should be included in theCHANGELOG.md
.
Edited by Takuya Noguchi