4

I followed the official guid deploied a pipline to analyse my code quality. Although the pipline passed and the job successed, the json file didn't generated by docker. And these notis displaied:

WARNING: A new version (v0.83.0) is available. Upgrade instructions are available at: https://github.com/codeclimate/codeclimate#packages Uploading artifacts... WARNING: gl-code-quality-report.json: no matching files ERROR: No files to upload
Job succeeded

And this is my /etc/gitlab-runner/config.toml file:

    concurrent = 1
    check_interval = 0

    [session_server]
      session_timeout = 1800

    [[runners]]
      name = "code_quality"
      url = "http://192.168.0.2/"
      token = "pyKK8v9C6Bnay8yMmfph"
      executor = "docker"
      [runners.docker]
        tls_verify = false
        image = "docker:stable"
        privileged = true
        cache_dir = "cache"
        disable_entrypoint_overwrite = false
        oom_kill_disable = false
        disable_cache = false
        volumes = ["/cache", "/var/run/docker.sock:/var/run/docker.sock"]
        shm_size = 0
      [runners.cache]
        [runners.cache.s3]
        [runners.cache.gcs]

My Gitlab version is 11.7

And this is my .gitlab-ci.yml file:

 code_quality:
      tags: 
        - quality
      image: docker:latest
      variables:
        DOCKER_DRIVER: overlay2
      before_script:
      - ip -4 a
      allow_failure: true
      services:
        - name: docker:stable-dind
          command: ["--insecure-registry=192.168.0.1:5000"]
      script:
        - ip -4 a
        - docker pull 192.168.0.1:5000/codeclimate:0.72.0
        - docker tag 192.168.0.1:5000/codeclimate:0.72.0 codeclimate/codeclimate:0.72.0
        - docker pull 192.168.0.1:5000/codeclimate-coffeelint:latest
        - docker tag 192.168.0.1:5000/codeclimate-coffeelint:latest codeclimate/codeclimate-coffeelint:latest
        - docker pull 192.168.0.1:5000/codeclimate-csslint:latest
        - docker tag 192.168.0.1:5000/codeclimate-csslint:latest codeclimate/codeclimate-csslint:latest
        - docker pull 192.168.0.1:5000/codeclimate-eslint:latest
        - docker tag 192.168.0.1:5000/codeclimate-eslint:latest codeclimate/codeclimate-eslint:latest
        - docker pull 192.168.0.1:5000/codeclimate-rubocop:latest
        - docker tag 192.168.0.1:5000/codeclimate-rubocop:latest codeclimate/codeclimate-rubocop:latest
        - docker pull 192.168.0.1:5000/codeclimate-fixme:latest
        - docker tag 192.168.0.1:5000/codeclimate-fixme:latest codeclimate/codeclimate-fixme:latest
        - docker pull 192.168.0.1:5000/codeclimate-structure:latest
        - docker tag 192.168.0.1:5000/codeclimate-structure:latest codeclimate/codeclimate-structure:latest
        - docker pull 192.168.0.1:5000/codeclimate-duplication:latest
        - docker tag 192.168.0.1:5000/codeclimate-duplication:latest codeclimate/codeclimate-duplication:latest
        - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
        - docker images
        - docker run
            --env SOURCE_CODE="$PWD"
            --env CODECLIMATE_VERSION=0.72.0
            --env TIMEOUT_SECONDS=900
            --volume "$PWD":/code
            --volume /var/run/docker.sock:/var/run/docker.sock
            192.168.0.1:5000/codequality:latest /code
      artifacts:
        reports:
          codequality: gl-code-quality-report.json

Due to I want increase the speed of pulling image, so I deployed a docker registry in localhost.

Can you give me some advice?

Thank you all!

fajin yu
  • 153
  • 1
  • 7

1 Answers1

1

ANyways, months later, if you are using Gitlab CE ths won't work, is a feature for EE only.

Ignus
  • 330
  • 3
  • 15
  • Okay, after I ask this question spent about a week to make it woke by modifi docker image, yaml file, config file. And I made a script to let result json file readable. And my coworker seems don't like this QAQ. – fajin yu Nov 26 '19 at 07:09
  • 2
    I got it to work on Gitlab-CE by calling codeclimate and have it export an html file instead of a json file. This is a lot easier to read and more helpful. [Here](https://gitlab.com/frakman1/codeclimate-test) is a sample project. – Frak Dec 22 '19 at 05:04
  • nice, i'll give it a try! – Ignus Dec 31 '19 at 13:41