我想在gitlab中运行codeclimate cli。这是我们的配置:
code_quality:
stage: test
image: docker:stable
variables:
DOCKER_DRIVER: overlay2
services:
- docker:stable-dind
allow_failure: true
script:
- docker pull codeclimate/codeclimate
- VOLUME_PATH=/tmp/builds"$(echo $PWD | sed 's|^/[^/]*||')"
- ls -la
- ls -lash $PWD
- echo $VOLUME_PATH
- echo $PWD
- ls ./services/dbservice
- docker run
--interactive
--env CODECLIMATE_CODE="$PWD"
--env CODECLIMATE_DEBUG=1
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
--volume /tmp/cc:/tmp/cc
codeclimate/codeclimate analyze
artifacts:
paths: [gl-code-quality-report.json]
但是当gitlab启动时,似乎由docker cli启动的dockercontainers无法找到代码。每次测试以0期结束。我还从本地使用docker cli开始测试,在那里发现了一些问题。
这是运行的详细输出: https://pastebin.com/i9rALiCv