Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Code Quality
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IGWN Computing and Software
GitLab
CICD Components
Code Quality
Commits
720aca61
Unverified
Commit
720aca61
authored
1 year ago
by
Ahmed Hemdan
Browse files
Options
Downloads
Patches
Plain Diff
Accept debug as input instead of CODECLIMATE_DEBUG variable
parent
9791c32e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+1
-2
1 addition, 2 deletions
.gitlab-ci.yml
README.md
+1
-0
1 addition, 0 deletions
README.md
template.yml
+9
-1
9 additions, 1 deletion
template.yml
with
11 additions
and
3 deletions
.gitlab-ci.yml
+
1
−
2
View file @
720aca61
...
...
@@ -9,12 +9,11 @@ include:
-
component
:
gitlab.com/$CI_PROJECT_PATH@$CI_COMMIT_SHA
inputs
:
stage
:
qa
debug
:
"
1"
# We customize the `code_quality` job to enable verbose logs (for debugging), and to also save the
# code quality report so it can be inspected by other jobs to verify it works correctly.
code_quality
:
variables
:
CODECLIMATE_DEBUG
:
1
artifacts
:
paths
:
-
gl-code-quality-report.json
...
...
This diff is collapsed.
Click to expand it.
README.md
+
1
−
0
View file @
720aca61
...
...
@@ -31,6 +31,7 @@ where `<VERSION>` is the latest released tag or `main`.
| ----- | ------------- | ----------- |
|
`stage`
|
`test`
| The stage where you want the job to be added |
|
`image`
|
`$CI_TEMPLATE_REGISTRY_HOST/gitlab-org/ci-cd/codequality:0.96.0`
| The Docker image of the analyzer |
|
`debug`
|
`""`
| Set to enable
[
CodeClimate debug mode
](
https://github.com/codeclimate/codeclimate#environment-variables
)
|
### Variables
...
...
This diff is collapsed.
Click to expand it.
template.yml
+
9
−
1
View file @
720aca61
...
...
@@ -4,6 +4,8 @@ spec:
default
:
test
image
:
default
:
"
$CI_TEMPLATE_REGISTRY_HOST/gitlab-org/ci-cd/codequality:0.96.0"
debug
:
default
:
"
"
---
code_quality
:
...
...
@@ -33,6 +35,12 @@ code_quality:
echo $CURRENT_ENV | grep "${VAR_NAME}=" > /dev/null && echo "--env $VAR_NAME "
done
}
-
|
function codeclimate_debug_var() {
if [ -n "$[[ inputs.debug ]]" ]; then
echo "--env CODECLIMATE_DEBUG=1"
fi
}
-
|
if [ -n "$CODECLIMATE_REGISTRY_USERNAME" ] && [ -n "$CODECLIMATE_REGISTRY_PASSWORD" ] && [ -n "$CODECLIMATE_PREFIX" ]; then
CODECLIMATE_REGISTRY=${CODECLIMATE_PREFIX%%/*}
...
...
@@ -44,7 +52,6 @@ code_quality:
$(propagate_env_vars \
SOURCE_CODE \
TIMEOUT_SECONDS \
CODECLIMATE_DEBUG \
CODECLIMATE_DEV \
REPORT_STDOUT \
REPORT_FORMAT \
...
...
@@ -53,6 +60,7 @@ code_quality:
CODECLIMATE_REGISTRY_USERNAME \
CODECLIMATE_REGISTRY_PASSWORD \
) \
$(codeclimate_debug_var) \
--volume "$PWD":/code \
--volume /var/run/docker.sock:/var/run/docker.sock \
"$[[ inputs.image ]]" /code
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment