Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
49d2d7b3
Commit
49d2d7b3
authored
Feb 19, 2018
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify the codequality job
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
70b61a3e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
11 deletions
+29
-11
.codeclimate.yml
.codeclimate.yml
+1
-1
.gitlab-ci.yml
.gitlab-ci.yml
+10
-10
scripts/codequality
scripts/codequality
+18
-0
No files found.
.codeclimate.yml
View file @
49d2d7b3
...
@@ -15,7 +15,7 @@ engines:
...
@@ -15,7 +15,7 @@ engines:
enabled
:
false
enabled
:
false
rubocop
:
rubocop
:
enabled
:
true
enabled
:
true
channel
:
"
gitlab-rubocop-0-52"
channel
:
"
gitlab-rubocop-0-52
-1
"
ratings
:
ratings
:
paths
:
paths
:
-
Gemfile.lock
-
Gemfile.lock
...
...
.gitlab-ci.yml
View file @
49d2d7b3
...
@@ -674,22 +674,22 @@ karma:
...
@@ -674,22 +674,22 @@ karma:
codequality
:
codequality
:
<<
:
*except-docs
<<
:
*except-docs
<<
:
*pull-cache
<<
:
*pull-cache
before_script
:
[]
image
:
docker:latest
stage
:
test
stage
:
test
variables
:
image
:
docker:latest
SETUP_DB
:
"
false"
before_script
:
[]
DOCKER_DRIVER
:
overlay
services
:
services
:
-
docker:dind
-
docker:dind
variables
:
SETUP_DB
:
"
false"
DOCKER_DRIVER
:
overlay2
CODECLIMATE_FORMAT
:
json
cache
:
{}
dependencies
:
[]
script
:
script
:
-
cp .rubocop.yml .rubocop.yml.bak
-
./scripts/codequality analyze -f json > codeclimate.json ||
true
-
grep -v "rubocop-gitlab-security" .rubocop.yml.bak > .rubocop.yml
-
docker run --env CODECLIMATE_CODE="$PWD" --volume "$PWD":/code --volume /var/run/docker.sock:/var/run/docker.sock --volume /tmp/cc:/tmp/cc dev.gitlab.org:5005/gitlab/gitlab-build-images:gitlab-codeclimate-v2 analyze -f json > raw_codeclimate.json
-
cat raw_codeclimate.json | docker run -i stedolan/jq -c 'map({check_name,fingerprint,location})' > codeclimate.json
-
mv .rubocop.yml.bak .rubocop.yml
artifacts
:
artifacts
:
paths
:
[
codeclimate.json
]
paths
:
[
codeclimate.json
]
expire_in
:
1 week
sast
:
sast
:
<<
:
*except-docs
<<
:
*except-docs
...
...
scripts/codequality
0 → 100755
View file @
49d2d7b3
#!/bin/sh
set
-eo
pipefail
code_path
=
$(
pwd
)
# docker run --tty will merge stderr and stdout, we don't need this on CI or
# it will break codequality json file
[
"
$CI
"
!=
""
]
||
docker_tty
=
"--tty"
docker pull dev.gitlab.org:5005/gitlab/gitlab-build-images:gitlab-codeclimate-rubocop-0-52-1
>
/dev/null
docker tag dev.gitlab.org:5005/gitlab/gitlab-build-images:gitlab-codeclimate-rubocop-0-52-1 codeclimate/codeclimate-rubocop:gitlab-codeclimate-rubocop-0-52-1
>
/dev/null
exec
docker run
--rm
$docker_tty
--env
CODECLIMATE_CODE
=
"
$code_path
"
\
--volume
"
$code_path
"
:/code
\
--volume
/var/run/docker.sock:/var/run/docker.sock
\
--volume
/tmp/cc:/tmp/cc
\
codeclimate/codeclimate:
${
CODECLIMATE_VERSION
:-
0
.71.1
}
"
$@
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment