A ready-to-use CI/CD Pipeline for analyzing your code with SonarCloud.
Run the following command in your project:
fluentci run sonar_pipeline
Or, if you want to use it as a template:
fluentci init -t sonar
This will create a .fluentci
folder in your project.
Now you can run the pipeline with:
fluentci run .
Use as a Dagger Module:
dagger install github.com/fluent-ci-templates/sonar-pipeline@main
Variable | Description | Required |
---|---|---|
SONAR_TOKEN | SonarCloud token | yes |
SONAR_ORGANIZATION | SonarCloud organization | yes |
SONAR_PROJECT_KEY | SonarCloud project key | yes |
SONAR_HOST_URL | SonarCloud host URL. Default: https://sonarcloud.io |
no |
SONAR_SOURCES | SonarCloud sources. Default: . |
no |
Job | Description |
---|---|
analyze | Run SonarScanner and push to SonarCloud. |
analyze(
src: string | Directory,
token: string | Secret,
organization?: string,
projectKey?: string,
sources?: string
): Promise<string>
You can also use this pipeline programmatically:
import { analyze } from "jsr:@fluentci/sonar";
await analyze();