Codefresh Steps: Reusable Code for Common Operations
This page provides code you can use to perform common operations in the Codefresh CI/CD platform.
35

sonar-scanner-dotnet-linux sonar-scanner-dotnet-linux

SonarScanner for .NET Core Sonarqube 7.5

arguments

  • DOTNET_COMMANDS - Commands to execute instead of the default scanning commands.
  • IMAGE - Sonarqube dotnet scanner Docker image.
  • IMAGE_TAG - Sonarqube dotnet scanner Docker image tag.
  • POST_COMMANDS - Commands to execute after scan command.
  • PRE_COMMANDS - Commands to execute before scan command.
  • REGISTRY - Sonarqube dotnet scanner Docker Registry.
  • SONAR_ANALYSIS_PARAMETERS - Array of additional Sonarqube Analysis Parameters Ex. - sonar.projectDescription='mycustomdescription'. List: https://docs.sonarqube.org/latest/analysis/analysis-parameters/
  • SONAR_HOST_URL - Sonarqube Server Host URL.
  • SONAR_LOGIN - Sonarqube Username or Token.
  • SONAR_PASSWORD - Sonarqube Password if using Username for SONAR_LOGIN.
  • SONAR_PROJECT_KEY - Sonarqube Project Key.
  • SONAR_PROJECT_NAME - Sonarqube Project Name.
  • SONAR_VERBOSE - Sonarqube Project Key.
  • WORKING_DIRECTORY - Subdirectory where dotnet project file exists.
    SonarqubeDotnetScan:
  type: sonar-scanner-dotnet-linux
  arguments:
    SONAR_HOST_URL: 'https://sonarqube.codefresh.io'
    SONAR_PROJECT_KEY: myprojectkey
    SONAR_LOGIN: myuser
    SONAR_PASSWORD: mypassword

  
    SonarqubeCustomDotnetScan:
  type: scan-project-custom-command
  arguments:
    SONAR_HOST_URL: 'https://sonarqube.codefresh.io'
    SONAR_PROJECT_KEY: myprojectkey
    SONAR_LOGIN: myuser
    SONAR_PASSWORD: mypassword
    DOTNET_COMMANDS:
      - docker build...
    SONAR_ANALYSIS_PARAMETERS:
      - sonar.projectDescription='myprojectdesc'
      - sonar.log.level=TRACE

  
github.com
Dustin Van Buskirk
Jun 28, 2021