Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Maven
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SmartDataLab
public
CI-CD components
Maven
Commits
841cedf8
Commit
841cedf8
authored
Aug 9, 2022
by
Pierre Smeyers
Browse files
Options
Downloads
Patches
Plain Diff
feat: migrate $SONAR_AUTH_TOKEN to $SONAR_TOKEN (standard)
parent
0edf6016
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+1
-1
1 addition, 1 deletion
README.md
kicker.json
+1
-1
1 addition, 1 deletion
kicker.json
templates/gitlab-ci-maven.yml
+9
-3
9 additions, 3 deletions
templates/gitlab-ci-maven.yml
with
11 additions
and
5 deletions
README.md
+
1
−
1
View file @
841cedf8
...
...
@@ -82,7 +82,7 @@ It is bound to the `test` stage, and uses the following variables:
| Name | description | default value |
| ------------------------ | -------------------------------------- | ----------------- |
|
`SONAR_HOST_URL`
| SonarQube server url | _none_ (disabled) |
| :lock:
`SONAR_
AUTH_
TOKEN`
| SonarQube authentication
[
token
](
https://docs.sonarqube.org/latest/user-guide/user-token/
)
(
depends
on your authentication method) | _none_ |
| :lock:
`SONAR_TOKEN`
| SonarQube authentication
[
token
](
https://docs.sonarqube.org/latest/user-guide/user-token/
)
(
depends
on your authentication method) | _none_ |
| :lock:
`SONAR_LOGIN`
| SonarQube login (depends on your authentication method) | _none_ |
| :lock:
`SONAR_PASSWORD`
| SonarQube password (depends on your authentication method) | _none_ |
|
`SONAR_BASE_ARGS`
| SonarQube
[
analysis arguments
](
https://docs.sonarqube.org/latest/analysis/analysis-parameters/
)
|
`sonar:sonar -Dsonar.links.homepage=${CI_PROJECT_URL} -Dsonar.links.ci=${CI_PROJECT_URL}/-/pipelines -Dsonar.links.issue=${CI_PROJECT_URL}/-/issues`
|
...
...
This diff is collapsed.
Click to expand it.
kicker.json
+
1
−
1
View file @
841cedf8
...
...
@@ -53,7 +53,7 @@
"mandatory"
:
true
},
{
"name"
:
"SONAR_
AUTH_
TOKEN"
,
"name"
:
"SONAR_TOKEN"
,
"description"
:
"SonarQube authentication [token](https://docs.sonarqube.org/latest/user-guide/user-token/) (depends on your authentication method)"
,
"secret"
:
true
},
...
...
This diff is collapsed.
Click to expand it.
templates/gitlab-ci-maven.yml
+
9
−
3
View file @
841cedf8
...
...
@@ -149,9 +149,9 @@ stages:
}
function sonar_http_auth_args() {
if [[ -n "$SONAR_
AUTH_
TOKEN" ]]
if [[ -n "$SONAR_TOKEN" ]]
then
echo "$SONAR_
AUTH_
TOKEN:"
echo "$SONAR_TOKEN:"
elif [[ -n "$SONAR_LOGIN" ]] && [[ -n "$SONAR_PASSWORD" ]]
then
echo "$SONAR_LOGIN:$SONAR_PASSWORD"
...
...
@@ -506,8 +506,14 @@ mvn-sonar:
log_warn '$SONAR_URL variable defined: use $SONAR_HOST_URL instead (see doc)'
export SONAR_HOST_URL="$SONAR_URL"
fi
-
|
if [[ "$SONAR_AUTH_TOKEN" ]] && [[ -z "$SONAR_TOKEN" ]]
then
log_warn '$SONAR_AUTH_TOKEN variable defined: use $SONAR_TOKEN instead (see doc)'
export SONAR_TOKEN="$SONAR_AUTH_TOKEN"
fi
-
if [[ "$SONAR_GITLAB_TOKEN" ]]; then sonar_extra_args="$SONAR_GITLAB_ARGS"; fi
-
mvn ${TRACE+-Dsonar.verbose=true} $MAVEN_CLI_OPTS $mvn_settings_opt $java_proxy_args
${SONAR_AUTH_TOKEN+-Dsonar.login=$SONAR_AUTH_TOKEN}
${SONAR_LOGIN+-Dsonar.login=$SONAR_LOGIN} ${SONAR_PASSWORD+-Dsonar.password=$SONAR_PASSWORD} $SONAR_BASE_ARGS $sonar_extra_args $sonar_mr_args
-
mvn ${TRACE+-Dsonar.verbose=true} $MAVEN_CLI_OPTS $mvn_settings_opt $java_proxy_args ${SONAR_LOGIN+-Dsonar.login=$SONAR_LOGIN} ${SONAR_PASSWORD+-Dsonar.password=$SONAR_PASSWORD} $SONAR_BASE_ARGS $sonar_extra_args $sonar_mr_args
-
if [[ "$SONAR_QUALITY_GATE_ENABLED" == "true" ]]; then sonar_quality_gate_check; fi
rules
:
# exclude if $SONAR_URL and $SONAR_HOST_URL not set
...
...
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
sign in
to comment