Commit 5dcec022 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch '5779_rename_code_quality_job_and_artifact-ee' into 'master'

Rename code quality job and artifact

See merge request gitlab-org/gitlab-ee!5773
parents 0f073e7b cc3caef9
...@@ -5,10 +5,10 @@ GitLab CI and Docker. ...@@ -5,10 +5,10 @@ GitLab CI and Docker.
First, you need GitLab Runner with [docker-in-docker executor][dind]. First, you need GitLab Runner with [docker-in-docker executor][dind].
Once you set up the Runner, add a new job to `.gitlab-ci.yml`, called `codequality`: Once you set up the Runner, add a new job to `.gitlab-ci.yml`, called `code_quality`:
```yaml ```yaml
codequality: code_quality:
image: docker:stable image: docker:stable
variables: variables:
DOCKER_DRIVER: overlay2 DOCKER_DRIVER: overlay2
...@@ -23,20 +23,27 @@ codequality: ...@@ -23,20 +23,27 @@ codequality:
--volume /var/run/docker.sock:/var/run/docker.sock --volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code "registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
artifacts: artifacts:
paths: [codeclimate.json] paths: [gl-code-quality-report.json]
``` ```
The above example will create a `codequality` job in your CI/CD pipeline which The above example will create a `code_quality` job in your CI/CD pipeline which
will scan your source code for code quality issues. The report will be saved will scan your source code for code quality issues. The report will be saved
as an artifact that you can later download and analyze. as an artifact that you can later download and analyze.
TIP: **Tip:** TIP: **Tip:**
Starting with [GitLab Starter][ee] 9.3, this information will Starting with [GitLab Starter][ee] 9.3, this information will
be automatically extracted and shown right in the merge request widget. To do be automatically extracted and shown right in the merge request widget. To do
so, the CI/CD job must be named `codequality` and the artifact path must be so, the CI/CD job must be named `code_quality` and the artifact path must be
`codeclimate.json`. `gl-code-quality-report.json`.
[Learn more on code quality diffs in merge requests](https://docs.gitlab.com/ee/user/project/merge_requests/code_quality_diff.html). [Learn more on code quality diffs in merge requests](https://docs.gitlab.com/ee/user/project/merge_requests/code_quality_diff.html).
CAUTION: **Caution:**
Code Quality was previously using `codeclimate` and `codequality` for job name and
`codeclimate.json` for the artifact name. While these old names
are still maintained they have been deprecated with GitLab 11.0 and may be removed
in next major release, GitLab 12.0. You are advised to update your current `.gitlab-ci.yml`
configuration to reflect that change.
[cli]: https://github.com/codeclimate/codeclimate [cli]: https://github.com/codeclimate/codeclimate
[dind]: ../docker/using_docker_build.md#use-docker-in-docker-executor [dind]: ../docker/using_docker_build.md#use-docker-in-docker-executor
[ee]: https://about.gitlab.com/products/ [ee]: https://about.gitlab.com/products/
...@@ -220,8 +220,8 @@ tests, it's up to you to add them. ...@@ -220,8 +220,8 @@ tests, it's up to you to add them.
### Auto Code Quality ### Auto Code Quality
Auto Code Quality uses the open source Auto Code Quality uses the
[`codeclimate` image](https://hub.docker.com/r/codeclimate/codeclimate/) to run [Code Quality image](https://gitlab.com/gitlab-org/security-products/codequality) to run
static analysis and other code checks on the current code. The report is static analysis and other code checks on the current code. The report is
created, and is uploaded as an artifact which you can later download and check created, and is uploaded as an artifact which you can later download and check
out. out.
......
...@@ -126,10 +126,10 @@ Next, a pipeline needs to be triggered. Since the test project doesn't have a ...@@ -126,10 +126,10 @@ Next, a pipeline needs to be triggered. Since the test project doesn't have a
manually visit `https://gitlab.com/<username>/minimal-ruby-app/pipelines/new`, manually visit `https://gitlab.com/<username>/minimal-ruby-app/pipelines/new`,
where `<username>` is your username. where `<username>` is your username.
This will create a new pipeline with several jobs: `build`, `test`, `codequality`, This will create a new pipeline with several jobs: `build`, `test`, `code_quality`,
and `production`. The `build` job will create a Docker image with your new and `production`. The `build` job will create a Docker image with your new
change and push it to the Container Registry. The `test` job will test your change and push it to the Container Registry. The `test` job will test your
changes, whereas the `codequality` job will run static analysis on your changes. changes, whereas the `code_quality` job will run static analysis on your changes.
Finally, the `production` job will deploy your changes to a production application. Finally, the `production` job will deploy your changes to a production application.
Once the deploy job succeeds you should be able to see your application by Once the deploy job succeeds you should be able to see your application by
......
...@@ -27,27 +27,28 @@ For instance, consider the following workflow: ...@@ -27,27 +27,28 @@ For instance, consider the following workflow:
## How it works ## How it works
>**Note:**
In [GitLab Starter][ee] 10.0, another job name will
also be supported: `codequality`. This new job name will eventually replace
`codeclimate` which is scheduled to be removed in GitLab 11.0. You are advised
to update your current `.gitlab-ci.yml` configuration to reflect that change.
In order for the report to show in the merge request, you need to specify a In order for the report to show in the merge request, you need to specify a
`codequality` job (exact name) that will analyze the code and upload the resulting `code_quality` job (exact name) that will analyze the code and upload the resulting
`codeclimate.json` as an artifact. GitLab will then check this file and show `gl-code-quality-report.json` as an artifact. GitLab will then check this file and show
the information inside the merge request. the information inside the merge request.
>**Note:** >**Note:**
If the Code Climate report doesn't have anything to compare to, no information If the Code Climate report doesn't have anything to compare to, no information
will be displayed in the merge request area. That is the case when you add the will be displayed in the merge request area. That is the case when you add the
`codequality` job in your `.gitlab-ci.yml` for the very first time. `code_quality` job in your `.gitlab-ci.yml` for the very first time.
Consecutive merge requests will have something to compare to and the code quality Consecutive merge requests will have something to compare to and the code quality
report will be shown properly. report will be shown properly.
For more information on how the `codequality` job should look like, check the For more information on how the `code_quality` job should look like, check the
example on [analyzing a project's code quality with Code Climate CLI][cc-docs]. example on [analyzing a project's code quality with Code Climate CLI][cc-docs].
CAUTION: **Caution:**
Code Quality was previously using `codeclimate` and `codequality` for job name and
`codeclimate.json` for the artifact name. While these old names
are still maintained they have been deprecated with GitLab 11.0 and may be removed
in next major release, GitLab 12.0. You are advised to update your current `.gitlab-ci.yml`
configuration to reflect that change.
[ee-1984]: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1984 [ee-1984]: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1984
[ee]: https://about.gitlab.com/products/ [ee]: https://about.gitlab.com/products/
[ci]: ../../../ci/README.md [ci]: ../../../ci/README.md
......
...@@ -7,7 +7,9 @@ module EE ...@@ -7,7 +7,9 @@ module EE
module Build module Build
extend ActiveSupport::Concern extend ActiveSupport::Concern
CODEQUALITY_FILE = 'codeclimate.json'.freeze # CODECLIMATE_FILE is deprecated and replaced with CODE_QUALITY_FILE (#5779)
CODECLIMATE_FILE = 'codeclimate.json'.freeze
CODE_QUALITY_FILE = 'gl-code-quality-report.json'.freeze
DEPENDENCY_SCANNING_FILE = 'gl-dependency-scanning-report.json'.freeze DEPENDENCY_SCANNING_FILE = 'gl-dependency-scanning-report.json'.freeze
LICENSE_MANAGEMENT_FILE = 'gl-license-report.json'.freeze LICENSE_MANAGEMENT_FILE = 'gl-license-report.json'.freeze
SAST_FILE = 'gl-sast-report.json'.freeze SAST_FILE = 'gl-sast-report.json'.freeze
...@@ -18,7 +20,7 @@ module EE ...@@ -18,7 +20,7 @@ module EE
DAST_FILE = 'gl-dast-report.json'.freeze DAST_FILE = 'gl-dast-report.json'.freeze
included do included do
scope :codequality, -> { where(name: %w[codequality codeclimate]) } scope :code_quality, -> { where(name: %w[codeclimate codequality code_quality]) }
scope :performance, -> { where(name: %w[performance deploy]) } scope :performance, -> { where(name: %w[performance deploy]) }
scope :sast, -> { where(name: 'sast') } scope :sast, -> { where(name: 'sast') }
scope :dependency_scanning, -> { where(name: 'dependency_scanning') } scope :dependency_scanning, -> { where(name: 'dependency_scanning') }
...@@ -46,8 +48,13 @@ module EE ...@@ -46,8 +48,13 @@ module EE
::Gitlab::Database::LoadBalancing::Sticking.stick(:build, id) ::Gitlab::Database::LoadBalancing::Sticking.stick(:build, id)
end end
# has_codeclimate_json? is deprecated and replaced with has_code_quality_json? (#5779)
def has_codeclimate_json? def has_codeclimate_json?
has_artifact?(CODEQUALITY_FILE) has_artifact?(CODECLIMATE_FILE)
end
def has_code_quality_json?
has_artifact?(CODE_QUALITY_FILE)
end end
def has_performance_json? def has_performance_json?
......
...@@ -12,8 +12,13 @@ module EE ...@@ -12,8 +12,13 @@ module EE
has_one :chat_data, class_name: 'Ci::PipelineChatData' has_one :chat_data, class_name: 'Ci::PipelineChatData'
end end
# codeclimate_artifact is deprecated and replaced with code_quality_artifact (#5779)
def codeclimate_artifact def codeclimate_artifact
@codeclimate_artifact ||= artifacts.codequality.find(&:has_codeclimate_json?) @codeclimate_artifact ||= artifacts.code_quality.find(&:has_codeclimate_json?)
end
def code_quality_artifact
@code_quality_artifact ||= artifacts.code_quality.find(&:has_code_quality_json?)
end end
def performance_artifact def performance_artifact
...@@ -78,10 +83,15 @@ module EE ...@@ -78,10 +83,15 @@ module EE
performance_artifact&.success? performance_artifact&.success?
end end
# has_codeclimate_data? is deprecated and replaced with has_code_quality_data? (#5779)
def has_codeclimate_data? def has_codeclimate_data?
codeclimate_artifact&.success? codeclimate_artifact&.success?
end end
def has_code_quality_data?
code_quality_artifact&.success?
end
def expose_sast_data? def expose_sast_data?
project.feature_available?(:sast) && project.feature_available?(:sast) &&
has_sast_data? has_sast_data?
...@@ -118,9 +128,14 @@ module EE ...@@ -118,9 +128,14 @@ module EE
has_performance_data? has_performance_data?
end end
# expose_codeclimate_data? is deprecated and replaced with expose_code_quality_data? (#5779)
def expose_codeclimate_data? def expose_codeclimate_data?
has_codeclimate_data? has_codeclimate_data?
end end
def expose_code_quality_data?
has_code_quality_data?
end
end end
end end
end end
...@@ -10,8 +10,11 @@ module EE ...@@ -10,8 +10,11 @@ module EE
has_many :approvers, as: :target, dependent: :delete_all # rubocop:disable Cop/ActiveRecordDependent has_many :approvers, as: :target, dependent: :delete_all # rubocop:disable Cop/ActiveRecordDependent
has_many :approver_groups, as: :target, dependent: :delete_all # rubocop:disable Cop/ActiveRecordDependent has_many :approver_groups, as: :target, dependent: :delete_all # rubocop:disable Cop/ActiveRecordDependent
# codeclimate_artifact is deprecated and replaced with code_quality_artifact (#5779)
delegate :codeclimate_artifact, to: :head_pipeline, prefix: :head, allow_nil: true delegate :codeclimate_artifact, to: :head_pipeline, prefix: :head, allow_nil: true
delegate :codeclimate_artifact, to: :base_pipeline, prefix: :base, allow_nil: true delegate :codeclimate_artifact, to: :base_pipeline, prefix: :base, allow_nil: true
delegate :code_quality_artifact, to: :head_pipeline, prefix: :head, allow_nil: true
delegate :code_quality_artifact, to: :base_pipeline, prefix: :base, allow_nil: true
delegate :performance_artifact, to: :head_pipeline, prefix: :head, allow_nil: true delegate :performance_artifact, to: :head_pipeline, prefix: :head, allow_nil: true
delegate :performance_artifact, to: :base_pipeline, prefix: :base, allow_nil: true delegate :performance_artifact, to: :base_pipeline, prefix: :base, allow_nil: true
delegate :sast_artifact, to: :head_pipeline, prefix: :head, allow_nil: true delegate :sast_artifact, to: :head_pipeline, prefix: :head, allow_nil: true
...@@ -61,11 +64,17 @@ module EE ...@@ -61,11 +64,17 @@ module EE
false false
end end
# expose_codeclimate_data? is deprecated and replaced with expose_code_quality_data? (#5779)
def expose_codeclimate_data? def expose_codeclimate_data?
!!(head_pipeline&.expose_codeclimate_data? && !!(head_pipeline&.expose_codeclimate_data? &&
base_pipeline&.expose_codeclimate_data?) base_pipeline&.expose_codeclimate_data?)
end end
def expose_code_quality_data?
!!(head_pipeline&.expose_code_quality_data? &&
base_pipeline&.expose_code_quality_data?)
end
def expose_performance_data? def expose_performance_data?
!!(head_pipeline&.expose_performance_data? && !!(head_pipeline&.expose_performance_data? &&
base_pipeline&.expose_performance_data?) base_pipeline&.expose_performance_data?)
......
...@@ -13,17 +13,33 @@ module EE ...@@ -13,17 +13,33 @@ module EE
end end
end end
# expose_codeclimate_data? is deprecated and replaced with expose_code_quality_data?
expose :codeclimate, if: -> (mr, _) { mr.expose_codeclimate_data? } do expose :codeclimate, if: -> (mr, _) { mr.expose_codeclimate_data? } do
expose :head_path, if: -> (mr, _) { can?(current_user, :read_build, mr.head_codeclimate_artifact) } do |merge_request| expose :head_path, if: -> (mr, _) { can?(current_user, :read_build, mr.head_codeclimate_artifact) } do |merge_request|
raw_project_build_artifacts_url(merge_request.source_project, raw_project_build_artifacts_url(merge_request.source_project,
merge_request.head_codeclimate_artifact, merge_request.head_codeclimate_artifact,
path: Ci::Build::CODEQUALITY_FILE) path: Ci::Build::CODECLIMATE_FILE)
end end
expose :base_path, if: -> (mr, _) { can?(current_user, :read_build, mr.base_codeclimate_artifact) } do |merge_request| expose :base_path, if: -> (mr, _) { can?(current_user, :read_build, mr.base_codeclimate_artifact) } do |merge_request|
raw_project_build_artifacts_url(merge_request.target_project, raw_project_build_artifacts_url(merge_request.target_project,
merge_request.base_codeclimate_artifact, merge_request.base_codeclimate_artifact,
path: Ci::Build::CODEQUALITY_FILE) path: Ci::Build::CODECLIMATE_FILE)
end
end
# We still expose it as `codeclimate` to keep compatibility with Frontend
expose :codeclimate, if: -> (mr, _) { mr.expose_code_quality_data? } do
expose :head_path, if: -> (mr, _) { can?(current_user, :read_build, mr.head_code_quality_artifact) } do |merge_request|
raw_project_build_artifacts_url(merge_request.source_project,
merge_request.head_code_quality_artifact,
path: Ci::Build::CODE_QUALITY_FILE)
end
expose :base_path, if: -> (mr, _) { can?(current_user, :read_build, mr.base_code_quality_artifact) } do |merge_request|
raw_project_build_artifacts_url(merge_request.target_project,
merge_request.base_code_quality_artifact,
path: Ci::Build::CODE_QUALITY_FILE)
end end
end end
......
---
title: Rename Code Quality job and artifact
merge_request: 5773
author:
type: deprecated
...@@ -13,8 +13,14 @@ describe Ci::Build do ...@@ -13,8 +13,14 @@ describe Ci::Build do
let(:job) { create(:ci_build, pipeline: pipeline) } let(:job) { create(:ci_build, pipeline: pipeline) }
describe '.codequality' do describe '.code_quality' do
subject { described_class.codequality } subject { described_class.code_quality }
context 'when a job name is codeclimate' do
let!(:job) { create(:ci_build, pipeline: pipeline, name: 'codeclimate') }
it { is_expected.to include(job) }
end
context 'when a job name is codequality' do context 'when a job name is codequality' do
let!(:job) { create(:ci_build, pipeline: pipeline, name: 'codequality') } let!(:job) { create(:ci_build, pipeline: pipeline, name: 'codequality') }
...@@ -22,8 +28,8 @@ describe Ci::Build do ...@@ -22,8 +28,8 @@ describe Ci::Build do
it { is_expected.to include(job) } it { is_expected.to include(job) }
end end
context 'when a job name is codeclimate' do context 'when a job name is code_quality' do
let!(:job) { create(:ci_build, pipeline: pipeline, name: 'codeclimate') } let!(:job) { create(:ci_build, pipeline: pipeline, name: 'code_quality') }
it { is_expected.to include(job) } it { is_expected.to include(job) }
end end
...@@ -138,7 +144,9 @@ describe Ci::Build do ...@@ -138,7 +144,9 @@ describe Ci::Build do
end end
BUILD_ARTIFACTS_METHODS = { BUILD_ARTIFACTS_METHODS = {
has_codeclimate_json?: Ci::Build::CODEQUALITY_FILE, # has_codeclimate_json? is deprecated and replaced with code_quality_artifact (#5779)
has_codeclimate_json?: Ci::Build::CODECLIMATE_FILE,
has_code_quality_json?: Ci::Build::CODE_QUALITY_FILE,
has_performance_json?: Ci::Build::PERFORMANCE_FILE, has_performance_json?: Ci::Build::PERFORMANCE_FILE,
has_sast_json?: Ci::Build::SAST_FILE, has_sast_json?: Ci::Build::SAST_FILE,
has_dependency_scanning_json?: Ci::Build::DEPENDENCY_SCANNING_FILE, has_dependency_scanning_json?: Ci::Build::DEPENDENCY_SCANNING_FILE,
......
...@@ -18,7 +18,13 @@ describe Ci::Pipeline do ...@@ -18,7 +18,13 @@ describe Ci::Pipeline do
end end
PIPELINE_ARTIFACTS_METHODS = [ PIPELINE_ARTIFACTS_METHODS = [
{ method: :codeclimate_artifact, options: [Ci::Build::CODEQUALITY_FILE, 'codequality'] }, # codeclimate_artifact is deprecated and replaced with code_quality_artifact (#5779)
{ method: :codeclimate_artifact, options: [Ci::Build::CODECLIMATE_FILE, 'codeclimate'] },
{ method: :codeclimate_artifact, options: [Ci::Build::CODECLIMATE_FILE, 'codequality'] },
{ method: :codeclimate_artifact, options: [Ci::Build::CODECLIMATE_FILE, 'code_quality'] },
{ method: :code_quality_artifact, options: [Ci::Build::CODE_QUALITY_FILE, 'codeclimate'] },
{ method: :code_quality_artifact, options: [Ci::Build::CODE_QUALITY_FILE, 'codequality'] },
{ method: :code_quality_artifact, options: [Ci::Build::CODE_QUALITY_FILE, 'code_quality'] },
{ method: :performance_artifact, options: [Ci::Build::PERFORMANCE_FILE, 'performance'] }, { method: :performance_artifact, options: [Ci::Build::PERFORMANCE_FILE, 'performance'] },
{ method: :sast_artifact, options: [Ci::Build::SAST_FILE, 'sast'] }, { method: :sast_artifact, options: [Ci::Build::SAST_FILE, 'sast'] },
{ method: :dependency_scanning_artifact, options: [Ci::Build::DEPENDENCY_SCANNING_FILE, 'dependency_scanning'] }, { method: :dependency_scanning_artifact, options: [Ci::Build::DEPENDENCY_SCANNING_FILE, 'dependency_scanning'] },
...@@ -54,7 +60,7 @@ describe Ci::Pipeline do ...@@ -54,7 +60,7 @@ describe Ci::Pipeline do
it { expect(pipeline.send(method)).to eq(build) } it { expect(pipeline.send(method)).to eq(build) }
end end
context 'no codequality job' do context 'no corresponding job' do
before do before do
create(:ci_build, pipeline: pipeline) create(:ci_build, pipeline: pipeline)
end end
...@@ -64,7 +70,7 @@ describe Ci::Pipeline do ...@@ -64,7 +70,7 @@ describe Ci::Pipeline do
end end
end end
%w(sast dast performance sast_container container_scanning).each do |type| %w(sast dependency_scanning dast performance sast_container container_scanning codeclimate code_quality).each do |type|
method = "has_#{type}_data?" method = "has_#{type}_data?"
describe "##{method}" do describe "##{method}" do
...@@ -78,7 +84,7 @@ describe Ci::Pipeline do ...@@ -78,7 +84,7 @@ describe Ci::Pipeline do
end end
end end
%w(sast dast performance sast_container container_scanning).each do |type| %w(sast dependency_scanning dast performance sast_container container_scanning codeclimate code_quality).each do |type|
method = "expose_#{type}_data?" method = "expose_#{type}_data?"
describe "##{method}" do describe "##{method}" do
......
...@@ -188,6 +188,23 @@ describe MergeRequest do ...@@ -188,6 +188,23 @@ describe MergeRequest do
end end
end end
describe '#expose_code_quality_data?' do
context 'with code_quality data' do
let(:pipeline) { double(expose_code_quality_data?: true) }
before do
allow(subject).to receive(:head_pipeline).and_return(pipeline)
allow(subject).to receive(:base_pipeline).and_return(pipeline)
end
it { expect(subject.expose_code_quality_data?).to be_truthy }
end
context 'without code_quality data' do
it { expect(subject.expose_code_quality_data?).to be_falsey }
end
end
describe '#expose_performance_data?' do describe '#expose_performance_data?' do
context 'with performance data' do context 'with performance data' do
let(:pipeline) { double(expose_performance_data?: true) } let(:pipeline) { double(expose_performance_data?: true) }
......
...@@ -26,6 +26,31 @@ describe MergeRequestWidgetEntity do ...@@ -26,6 +26,31 @@ describe MergeRequestWidgetEntity do
expect(subject.as_json[:blob_path]).to include(:head_path) expect(subject.as_json[:blob_path]).to include(:head_path)
end end
# methods for old artifact are deprecated and replaced with ones for the new name (#5779)
it 'has codeclimate data (with old artifact name codeclimate,json)' do
build = create(:ci_build, name: 'job')
allow(merge_request).to receive_messages(
expose_codeclimate_data?: true,
base_codeclimate_artifact: build,
head_codeclimate_artifact: build
)
expect(subject.as_json).to include(:codeclimate)
end
it 'has codeclimate data (with new artifact name gl-code-quality-report.json)' do
build = create(:ci_build, name: 'job')
allow(merge_request).to receive_messages(
expose_code_quality_data?: true,
base_code_quality_artifact: build,
head_code_quality_artifact: build
)
expect(subject.as_json).to include(:codeclimate)
end
it 'has performance data' do it 'has performance data' do
build = create(:ci_build, name: 'job') build = create(:ci_build, name: 'job')
......
...@@ -217,7 +217,7 @@ export const pipelineWithStages = { ...@@ -217,7 +217,7 @@ export const pipelineWithStages = {
browse_path: '/gitlab-org/gitlab-ee/-/jobs/62411442/artifacts/browse', browse_path: '/gitlab-org/gitlab-ee/-/jobs/62411442/artifacts/browse',
}, },
{ {
name: 'codequality', name: 'code_quality',
expired: false, expired: false,
expire_at: '2018-04-18T14:16:24.484Z', expire_at: '2018-04-18T14:16:24.484Z',
path: '/gitlab-org/gitlab-ee/-/jobs/62411441/artifacts/download', path: '/gitlab-org/gitlab-ee/-/jobs/62411441/artifacts/download',
......
...@@ -77,7 +77,7 @@ test: ...@@ -77,7 +77,7 @@ test:
only: only:
- branches - branches
codequality: code_quality:
image: docker:stable image: docker:stable
variables: variables:
DOCKER_DRIVER: overlay2 DOCKER_DRIVER: overlay2
...@@ -86,9 +86,9 @@ codequality: ...@@ -86,9 +86,9 @@ codequality:
- docker:stable-dind - docker:stable-dind
script: script:
- setup_docker - setup_docker
- codeclimate - code_quality
artifacts: artifacts:
paths: [codeclimate.json] paths: [gl-code-quality-report.json]
performance: performance:
stage: performance stage: performance
...@@ -409,7 +409,7 @@ rollout 100%: ...@@ -409,7 +409,7 @@ rollout 100%:
./clair-scanner -c http://docker:6060 --ip $(hostname -i) -r gl-container-scanning-report.json -l clair.log -w clair-whitelist.yml ${CI_APPLICATION_REPOSITORY}:${CI_APPLICATION_TAG} || true ./clair-scanner -c http://docker:6060 --ip $(hostname -i) -r gl-container-scanning-report.json -l clair.log -w clair-whitelist.yml ${CI_APPLICATION_REPOSITORY}:${CI_APPLICATION_TAG} || true
} }
function codeclimate() { function code_quality() {
docker run --env SOURCE_CODE="$PWD" \ docker run --env SOURCE_CODE="$PWD" \
--volume "$PWD":/code \ --volume "$PWD":/code \
--volume /var/run/docker.sock:/var/run/docker.sock \ --volume /var/run/docker.sock:/var/run/docker.sock \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment