Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/commands/scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ steps:
- run:
name: SonarQube Cloud
environment:
SONAR_TOKEN_VARIABLE_NAME: <<pipeline.parameters.sonar_token_variable_name>>
PROJECT_ROOT: <<parameters.project_root>>
command: <<include(scripts/scan.sh)>>
- save_cache:
Expand Down
3 changes: 2 additions & 1 deletion src/scripts/scan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

set -e
VERSION=7.1.0.4889
SONAR_TOKEN=${SONAR_TOKEN:?Environment variable SONAR_TOKEN is required}
SONAR_TOKEN_VARIABLE_NAME=${SONAR_TOKEN_VARIABLE_NAME:?Environment variable SONAR_TOKEN_VARIABLE_NAME is required}
SONAR_TOKEN=$(printenv "$SONAR_TOKEN_VARIABLE_NAME" 2>/dev/null || { echo "Environment variable $SONAR_TOKEN_VARIABLE_NAME is required" >&2; exit 1; })
SCANNER_DIRECTORY=/tmp/cache/scanner
export SONAR_USER_HOME=$SCANNER_DIRECTORY/.sonar
OS="linux"
Expand Down