-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CCS-4 Enhance jira and Sonar evidence extraction and add documentation
- Loading branch information
1 parent
c90afa3
commit 4f9c85f
Showing
10 changed files
with
69 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+16 Bytes
(100%)
examples/jira-transition-example/bin/jira-transition-checker-darwin-arm64
Binary file not shown.
Binary file modified
BIN
-96 Bytes
(100%)
examples/jira-transition-example/bin/jira-transition-checker-linux-amd64
Binary file not shown.
Binary file modified
BIN
+352 Bytes
(100%)
examples/jira-transition-example/bin/jira-transition-checker-linux-arm64
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Create Sonar Scan Evidence predicate from the build CI and attach it to the build info | ||
Sonar is a code scanning tool that helps to identify bugs, vulnerabilities, and code smells in your code. | ||
It is important to track the code quality and security of the code changes done and released. | ||
To allow automation of proper code quality and security checks, we create an evidence of the Sonar scan results | ||
during the build with confirmation that the code quality and security checks passed before the code was committed. | ||
using the `FailOnAnalysisFailure` argument the customer can decide if to create the sonar scan evidence if the scan did not pass | ||
sonar quality gates, or fail the predicate creation with exist status 1. | ||
If the Analysis status is not 'OK', but `FailOnAnalysisFailure` was not set, then the predicate is created with analysis.status = 'ERROR' which | ||
should be checked using a policy. | ||
|
||
## Environment variables | ||
- `SONAR_TOKEN` - The sonar server token. | ||
|
||
## Arguments | ||
--reportTaskFile=<path> - The path to the sonar report task file. | ||
--FailOnAnalysisFailure - Fail with exit code 1 if the sonar analysis failed in sonar quality gate. | ||
|
||
|
||
## The example is based on the following steps: | ||
1. set sonar token as an environment variable | ||
2. call sonar scan | ||
for example: | ||
`` | ||
$PWD/sonar-scanner-6.2.1.4610/bin/sonar-scanner \ | ||
-Dsonar.projectKey=my-sonar-project-key \ | ||
-Dsonar.organization=my-sonar-org \ | ||
-Dsonar.host.url=https://sonarcloud.io \ | ||
-Dsonar.java.jdkHome=$JAVA_HOME \ | ||
-Dsonar.verbose=true \ | ||
-Dsonar.token=$SONAR_TOKEN | ||
`` | ||
3. call the jira-transition-checker utility (use the binary for your build platform) with these arguments: "transition name" JIRA-ID [,JIRA-ID] | ||
for example: | ||
``./examples/sonar-scan-example/bin/sonar-scan-extractor-linux-amd64 --reportTaskFile=$PWD/.scannerwork/report-task.txt --FailOnAnalysisFailure > predicate.json | ||
`` | ||
4. call the evidence create cli with the predicate.json file | ||
for example: | ||
`` | ||
jf evd create \ | ||
--build-name $GITHUB_WORKFLOW \ | ||
--build-number "${{ github.run_number }}" \ | ||
--predicate ./predicate.json \ | ||
--predicate-type https://jfrog.com/evidence/sonar-scan/v1 \ | ||
--key "${{ secrets.JIRA_TEST_PKEY }}" \ | ||
--key-alias ${{ vars.JIRA_TEST_KEY }} | ||
`` |
Binary file modified
BIN
-144 Bytes
(100%)
examples/sonar-scan-example/bin/sonar-scan-extractor-darwin-arm64
Binary file not shown.
Binary file modified
BIN
-5.31 KB
(100%)
examples/sonar-scan-example/bin/sonar-scan-extractor-linux-amd64
Binary file not shown.
Binary file modified
BIN
-1.7 KB
(100%)
examples/sonar-scan-example/bin/sonar-scan-extractor-linux-arm64
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters