summaryrefslogtreecommitdiff
path: root/scripts/codequality
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2018-02-22 12:09:27 +0000
committerGrzegorz Bizon <grzegorz@gitlab.com>2018-02-22 12:09:27 +0000
commit011ddb51b40897bc13a75d78c9e992f559cbde48 (patch)
treed2f25aa76ab1466ecca82d2cf07e3594b8d7addc /scripts/codequality
parenta75cce1febf0403d66631841fff3bfbeefbfe6e3 (diff)
parenteb421c88ee2a57a437b9b14ba7447a04720354ac (diff)
downloadgitlab-ce-011ddb51b40897bc13a75d78c9e992f559cbde48.tar.gz
Merge branch 'master' into 'backstage/gb/build-stages-catch-up-migration'
# Conflicts: # db/schema.rb
Diffstat (limited to 'scripts/codequality')
-rwxr-xr-xscripts/codequality19
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/codequality b/scripts/codequality
new file mode 100755
index 00000000000..2f3ccef7d2d
--- /dev/null
+++ b/scripts/codequality
@@ -0,0 +1,19 @@
+#!/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"
+
+# The codebase and instructions for the following image can be found at https://gitlab.com/gitlab-org/codeclimate-rubocop/wikis/home
+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}" "$@"