Changes for page Jenkins Shared Library
Last modified by Boris Folgmann on 2025/11/03 09:41
From version 9.3
edited by Boris Folgmann
on 2025/11/03 09:20
on 2025/11/03 09:20
Change comment:
There is no comment for this version
To version 3.3
edited by Achim Mahnke
on 2025/10/27 12:52
on 2025/10/27 12:52
Change comment:
There is no comment for this version
Summary
-
Page properties (2 modified, 0 added, 0 removed)
-
Attachments (0 modified, 0 added, 2 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -xwiki:XWiki. borisfolgmannt-systemscom1 +xwiki:XWiki.achimmahnket-systemscom - Content
-
... ... @@ -6,7 +6,7 @@ 6 6 7 7 == Getting Started == 8 8 9 -Since the Shared Library is globally configured on all Jenkins instances managed by DevOps-as-a-Service you just need to place the following very short Jenkinsfile in the root folder of your git repository to automatically build your maven ,nodeor goproject or simply build a container using a Dockerfile.9 +Since the Shared Library is globally configured on all Jenkins instances managed by DevOps-as-a-Service you just need to place the following very short Jenkinsfile in the root folder of your git repository to automatically build your maven or node project or simply build a container using a Dockerfile. 10 10 11 11 {{code}} 12 12 @Library('sdcloud') _ ... ... @@ -21,15 +21,14 @@ 21 21 22 22 What the pipeline currently does is visualised in the following image which shows an example for a maven-based Java project. 23 23 24 -[[image:17 62161531690-966.png||data-xwiki-image-style-border="true"height="247" width="1654"]]24 +[[image:attach:image2022-5-17_17-51-43.png||height="250"]] 25 25 26 -1. sdcPipeline prints some valuable information about this shared Jenkinslib. Allocates a node (Jenkins Agent) to start executing 27 27 1. Checking out the source code from git. 28 28 1. If a pom.xml is found your favorite JDK is selected, by default jdk11. Then a maven build is done. 29 29 1. If there's no pom.xml but a package.json is found a nodejs build is done. 30 30 1. If there is no pom.xml or package.json but a go.mod file, a go build is done. 31 31 1. Then the following stages are executed in parallel 32 -11. Analysis: For maven projects the Java source code is checked by checkstyle, pmd and spotbugs. Furthermore the job output will be checked for any warnings generated by maven, javac or javadoc. If Python modules (.py files) exist in the git repository they will be analyzed using pylint and flake8. If pylint or flake8 are not available on the Jenkins agent the steps will be skipped. Python files that are generated or downloaded into the workspace will not be checked. The results will be displayed on the classical Jenkins build page after the build. ForGo projects, the Go test tool is used to run all tests and produce a coverage output file for SonarQube. Additionally, the gotestsum tool is used to produce a report which is picked up by Jenkins.</dd>31 +11. Analysis: For maven projects the Java source code is checked by checkstyle, pmd and spotbugs. Furthermore the job output will be checked for any warnings generated by maven, javac or javadoc. If Python modules (.py files) exist in the git repository they will be analyzed using pylint and flake8. If pylint or flake8 are not available on the Jenkins agent the steps will be skipped. Python files that are generated or downloaded into the workspace will not be checked. The results will be displayed on the classical Jenkins build page after the build. 33 33 11. Security: If it's not a feature or bugfix branch a dependency check is done which checks if e.g. libraries are used which have known vulnerabilities. The results will be displayed in Jenkins after the build. 34 34 11. Docker: this will also work for projects which are neither maven or nodejs. A Dockerfile is enough to trigger this part of the pipeline. 35 35 111. If a Dockerfile is found a docker image is built. ... ... @@ -127,14 +127,8 @@ 127 127 )))|((( 128 128 'npm install && npm run build ~-~-prod' 129 129 )))|((( 130 -npm command to execute for building Node.JS projects. 129 +npm command to execute for building Node.JS projects. 131 131 ))) 132 -|= |go|'go'|Golang version to use. 133 -Refers to a symbolic name of a go tool configuration in Jenkins. 134 -|= |goBuildCommand|((( 135 -'go build -o app cmd/server/main.go' 136 -)))|go build run. Should be overridden for your project. 137 -|= |goTestCommand|'gotestsum ~-~-format pkgname ~-~-junitfile report.xml ~-~- -failfast -race -coverprofile=coverage.out -tags=test ./...'|Runs gotestsum tool which in turn calls 'go test' for all packages in the project. Should be overridden for your project. The gotestsum tool is available out-of-the-box and produces a report file which is picked up by Jenkins automatically. 138 138 |=(% rowspan="10" %)((( 139 139 Docker build 140 140 )))|((( ... ... @@ -313,11 +313,9 @@ 313 313 |((( 314 314 helmRegistry 315 315 )))|((( 316 - Helmregistry of your DOaaS instance, which is usally 'https:~/~/registry-CUSTOMER.devops.t-systems.net/chartrepo/PROJECTKEY'309 +Nexus registry of your DOaaS instance 317 317 )))|((( 318 -Helm registry to which the packaged Helm chart is uploaded. 319 - 320 - 311 +Name of registry to which the packaged Helm chart is uploaded. 321 321 ))) 322 322 |((( 323 323 helmRegistryCredentialsId ... ... @@ -356,7 +356,7 @@ 356 356 )))|((( 357 357 Id of the Jenkins Credentials for signers private keyfile. 358 358 ))) 359 -|=(% colspan="1" rowspan=" 8" %)(((350 +|=(% colspan="1" rowspan="12" %)((( 360 360 Static Source Code Analysis 361 361 )))|((( 362 362 checkstyleConfig ... ... @@ -381,7 +381,29 @@ 381 381 )))|((( 382 382 Name of a config file to use for yamllint. If not set a best-practice[[ relaxed configuration >>url:https://prd.sdc.t-systems.net/bitbucket/projects/DEVOPSAAS/repos/sdcloud-caas-jenkins-libs/browse/resources/com/tsystems/sdc/jenkinslib/yamllint.yml||shape="rect"]]is used which is different from the original yamllint[[ config>>url:https://yamllint.readthedocs.io/en/stable/configuration.html#default-configuration||shape="rect"]]. 383 383 ))) 375 +|skipDependencyCheck|false|Set to true to skip the dependency-check. 384 384 |((( 377 +dependencyCheckTool 378 +)))|((( 379 +'dependency-check' 380 +)))|((( 381 +Defines which named dependency-check tool should be used. 382 +))) 383 +|((( 384 +dependencyCheckArgs 385 +)))|((( 386 +'~-~-disableAssembly ~-~-nvdValidForHours 720' 387 +)))|((( 388 +Addtional arguments which are be passed to dependency-check. See [[Dependency>>url:https://jeremylong.github.io/DependencyCheck/dependency-check-cli/arguments.html||shape="rect"]][[ Check CLI Arguments>>url:https://jeremylong.github.io/DependencyCheck/dependency-check-cli/arguments.html||shape="rect"]] for more information. 389 +))) 390 +|((( 391 +dependencyCheckNvdApiKeyCredentialsId 392 +)))|((( 393 +'dependency-check-nvdapikey' 394 +)))|((( 395 +If you have your own NVD API Key, set it as a credential of type text in Jenkins. Then specify the credential id using this argument. It will be automatically passed to dependency-check. There will be no error if no credential is found. Just the NVD download will be slower. Please note, on DevOps-as-a-Service a shared NVD API Key is automatically supplied for the default credential id. 396 +))) 397 +|((( 385 385 sonarQube 386 386 )))|((( 387 387 true for the defaultBranch and for pull-requests, if a SonarQube version is detected which supports scanning multiple branches ... ... @@ -432,23 +432,6 @@ 432 432 |sonarQualityGate| |Sets the desired quality gate to use for the scan result in SonarQube. 433 433 If not specified, the quality gate is not changed. 434 434 As a default, SonarQube will use the quality gate "Sonar way" for new scan results. 435 -|=(% colspan="1" rowspan="5" %)Dependency Check|skipDependencyCheck|false|Set to true to skip the dependency-check. 436 -|dependencyCheckTool|'dependency-check'|Defines which named dependency-check tool should be used. 437 -|dependencyCheckMvnArgs|'-DassemblyAnalyzerEnabled=false'|Additional arguments which are be passed to dependency-check for maven projects.((( 438 -See [[Dependency Check Maven Configuration>>https://jeremylong.github.io/DependencyCheck/dependency-check-maven/configuration.html]] for more information. 439 -))) 440 -|dependencyCheckArgs|'~-~-disableAssembly'|Addtional arguments which are be passed to dependency-check. See [[Dependency>>url:https://jeremylong.github.io/DependencyCheck/dependency-check-cli/arguments.html||shape="rect"]][[ Check CLI Arguments>>url:https://jeremylong.github.io/DependencyCheck/dependency-check-cli/arguments.html||shape="rect"]] for more information. 441 -|dependencyCheckNvdApiKeyCredentialsId|'dependency-check-nvdapikey'|If you have your own NVD API Key, set it as a credential of type text in Jenkins. Then specify the credential id using this argument. It will be automatically passed to dependency-check. There will be no error if no credential is found. Just the NVD download will be slower. Please note, on DevOps-as-a-Service a shared NVD API Key is automatically supplied for the default credential id. 442 -|=(% colspan="1" rowspan="2" %)Dependency Track|depTrackCredentialsId|'PROJECTKEY-deptrack-projectcreator'|((( 443 -Id of the Jenkins Credential which has to be used to authenticate to Dependency Track for publishing the SBOM. 444 -))) 445 -|depTrackClassifier|'application'|The component type (e.g. application, library, firmware, ...) that should be set in the SBOM file. 446 -Will be later shown as classifier for the project in Dependency Track. 447 -See [[CycloneDX Metadata Component Type>>https://cyclonedx.org/docs/1.6/json/#metadata_component_type]] for supported values. 448 -|=(% colspan="1" rowspan="2" %)Trivy|trivySeverity|'High'|String which sets the minimum severity of Trivy findings that has to be reached to mark the Trivy Results stage as unstable. 449 -Possible values are: "None", "Unknown", "Negligible", "Low", "Medium", "High", "Critical". 450 -|trivyBuildResult|'SUCCESS'|String which sets the overall build result when the result of the Trivy scan reaches trivyServerity. 451 -Possible values are: "SUCCESS", "UNSTABLE" or "FAILURE" 452 452 |=(% rowspan="7" %)((( 453 453 Deployment 454 454 )))|(((
- 1762161476370-318.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -xwiki:XWiki.borisfolgmannt-systemscom - Size
-
... ... @@ -1,1 +1,0 @@ 1 -79.4 KB - Content
- 1762161531690-966.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -xwiki:XWiki.borisfolgmannt-systemscom - Size
-
... ... @@ -1,1 +1,0 @@ 1 -82.3 KB - Content