Skip to content

Tooark/sonarqube-template-include

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 

Repository files navigation

📦 Gitlab include for Sonarqube Scan and Quality Gate — sonarqube-template-include

This Gitlab include Scan and rate a Quality Gate from project.

✨ Supported Project Types

This template officially supports the following project ecosystems:

  • dotnet: For .NET and .NET Core projects (.csproj or .sln).
  • node: For any JavaScript/TypeScript project that uses npm (package.json), including frontend (React, Vue, Angular) and backend (Node.js) applications.

Requirements

This include needs tags on your runners named "amd64" because de architecture is amd64(x86) on Sonarqube CLI and Docker Image base used

🔧 Inputs

Input Description Default Required
stage The GitLab CI/CD stage where the SonarQube job will run. sonarqube No
environment The GitLab CI/CD Environment where the SonarQube job will pull variables values. sonarqube No
language The project type to be scanned. Accepted values: dotnet, node. - Yes
dotnet_version The .NET SDK version to use for the analysis. 8.0 Only for dotnet
dotnet_path_sln_or_csproj The relative path to your .sln or .csproj file. - Yes, for dotnet

If your project is .NET, really necessary inputs:

  • dotnet_version: .NET version utilized in csproj or sln file.
  • dotnet_path_sln_or_csproj: Path to .csproj or .sln file in your project.

And necessary Variables on your Gitlab environment(default is "sonarqube")

  • SONAR_PROJECT_KEY: Your Sonarqube project Key
  • SONAR_HOST_URL: Your Sonarqube host url
  • SONAR_TOKEN: Your Sonarqube token

🚀 How to Use

Add the following to your .gitlab-ci.yml file.

For .NET Projects

include:
- remote: 'https://raw.githubusercontent.com/Tooark/sonarqube-template-include/main/.gitlab-ci.yml'
  inputs:
    language: "dotnet"
    dotnet_version: "9.0"
    dotnet_path_sln_or_csproj: "./src/my-project.sln" # or my-project.csproj

For JavaScript/TypeScript (Node.js) Projects

include:
- remote: 'https://raw.githubusercontent.com/Tooark/sonarqube-template-include/main/.gitlab-ci.yml'
  inputs:
    language: "node"

Contribution

Contributions are welcome! Feel free to open issues and pull requests in the Notification Trigger Url repository.


Contributors

The following users are contributing to the project:

Stenio Ignacio

About

Template para utilizar Scan e Quality Gate do Sonarqube em pipelines Gitlab CI/CD

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors