1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00
Commit Graph

746 Commits

Author SHA1 Message Date
Oliver Nocon
cd2fb914fa
feat: allow linting failures (#4355)
Co-authored-by: Anil Keshav <anil.keshav@sap.com>
2024-01-25 11:44:24 +01:00
Daria Kuznetsova
6920cad511
feat(codeqlExecuteScan): adding data to InfluxDB (#4780)
* added influxdb to params, added log for testing

* changed fields for codeql influx db

* added setting codeql findings to influx

* refactored

* fixed typo

* added tests
2024-01-17 11:38:16 +03:00
Dmitrii Pavlukhin
808b21fa79
Add maven native-like build workaround for detect (#4712)
* added-native-like-build

* pom-path-uncommented

* Run install only for maven

* Added log

* debug

* Print config params

* Added pipeline env

* Added parameter to specify path to pom.xml

* Returned condition

* Added logging of config in verbose mode

---------

Co-authored-by: Andrei Kireev <a-kireev1989@mail.ru>
Co-authored-by: Andrei Kireev <andrei.kireev@sap.com>
2024-01-15 22:50:22 +01:00
Dmitrii Pavlukhin
89e1e01ae9
Temporary Fix docker images timeout issue (#4762)
* returned-the-old-way-of-handling-images

* introduced-additional-parameter

* amended-the-description

* amended-condition
2024-01-09 15:22:54 +03:00
Dmitrii Pavlukhin
f5f72bcc7c
Remove useDetect7 option (#4717)
* removed-detect7-option

* linting-fix

* removed-comment
2024-01-08 13:21:44 +03:00
Dmitrii Pavlukhin
6cc6a4e80a
Feature - whitesourceExecuteScan - adding ability to scan multiple docker images (#4755)
* added-multiple-images-scan-logic

* amended-description

* added-reference-to-common-pipeline-env
2024-01-05 18:23:55 +03:00
Vyacheslav Starostin
083826485c
imagePushToRegistry: update sourceImages and targetImages parameters (#4707)
* Add imageTag param

* Make imageTag mandatory if tagArtifactVersion is true && update logic

* Make sourceRegistryURL mandatory if localDockerImagePath is not set

* Make some param mandatoryIf

* Change format of sourceImages param

* Add source image tag

* Update sourceImages and targetImages params

* Delete unused function

* Clean up tests

* Update

* Update metadata file

* Update tests

* Fix test

* Fix tests
2023-12-12 15:05:03 +06:00
Daria Kuznetsova
aab4de4597
feat(codeqlExecuteScan): added params projectSettingsFile and globalSettingsFile (#4702)
* added settings file params

* added checking build tool
2023-12-01 12:45:31 +03:00
Anil Keshav
8dc2a1bfb4
feat: Add imagePushToRegistry step (#4609)
* imagePushToRegistry new step

* adding copy and push functionality

* including only copy correctly

* groovy step for imagePushToRegistry

* create .docker folder

* imagePushToRegistry new step

* adding copy and push functionality

* including only copy correctly

* groovy step for imagePushToRegistry

* create .docker folder

* fix CopyImage

* test

* test

* Correct docker config path

* Update

* Update

* Update

* Update

* Update

* Use creds from Vault

* Use creds from Vault

* Use creds from Vault

* Use creds from Vault

* Test

* Comment some logic

* Test: move regexp logic

* Test

* Update

* Update

* Clean up

* Update

* Update

* Update interface

* Rename function

* imagePushToRegistry: small refactoring (#4688)

* imagePushToRegistry new step

* adding copy and push functionality

* including only copy correctly

* groovy step for imagePushToRegistry

* create .docker folder

* Correct docker config path

* Update

* Update

* Update

* Update

* Update

* Use creds from Vault

* Use creds from Vault

* Use creds from Vault

* Use creds from Vault

* Test

* Comment some logic

* Test: move regexp logic

* Test

* Update

* Update

* Clean up

* Update

* Update

---------

Co-authored-by: Keshav <anil.keshav@sap.com>
Co-authored-by: Muhammadali Nazarov <muhammadalinazarov@gmail.com>

* Update step yaml file

* Update interface

* Rename func

* Update tests

* Update interface, create mock methods, update tests

* Update mock

* Add md file

* Fix groovy doc, unit test, go unit test

* Update

* Add unit tests

* Support tagLatest param

* Fetch source creds from Vault

* Update yaml file

* Support multiple images

* Update test

* Support copy images in parallel

* Update yaml

* Clean up

* Return err if no creds provided

* Fix tests

* Add err msg

* Add debug log

* Do not use CPE for targetImages

* Support platform

* Delete Jenkins specific creds

* Update groovy: do not handle Jenkins creds

* Delete unused code

* Fix: Support platform

* Fix: Support platform

* Apply suggestion from code review

Co-authored-by: Egor Balakin <14162703+m1ron0xFF@users.noreply.github.com>

* Apply suggestion from code review

Co-authored-by: Egor Balakin <14162703+m1ron0xFF@users.noreply.github.com>

* Add tests for parseDockerImageName

* Add comment that tagArtifactVersion is not supported yet

* Set limit of running goroutines

* Fix: Set limit of running goroutines

* The tagArtifactVersion is not supported yet

---------

Co-authored-by: Muhammadali Nazarov <muhammadalinazarov@gmail.com>
Co-authored-by: Egor Balakin <egor.balakin@sap.com>
Co-authored-by: Vyacheslav Starostin <vyacheslav.starostin@sap.com>
Co-authored-by: Vyacheslav Starostin <32613074+vstarostin@users.noreply.github.com>
Co-authored-by: Egor Balakin <14162703+m1ron0xFF@users.noreply.github.com>
2023-11-30 15:06:31 +06:00
Oliver Feldmann
17de9ed34c
Allow cALM service key for cTMS steps (#4661)
* Allow cALM service keys

* Fix typo

Co-authored-by: Srinikitha Kondreddy <srinikitha.kondreddy@sap.com>

* fix typo

Co-authored-by: Srinikitha Kondreddy <srinikitha.kondreddy@sap.com>

* Hardcode tms endpoint in calm test case

* Add new serviceKey parameter

* Use new serviceKey parameter

With deprecation warning if old tmsServiceKey parameter is used

* Add unit tests and optimise

* Remove tms from service key log message

* Apply suggestions from code review

Co-authored-by: Artem Bannikov <62880541+artembannikov@users.noreply.github.com>

* Remove unused json fields mapping

* Apply review suggestion

* Apply further review suggestions

* Use new parameter name in groovy

* Generate again

* Fix groovy test

---------

Co-authored-by: Srinikitha Kondreddy <srinikitha.kondreddy@sap.com>
Co-authored-by: Artem Bannikov <62880541+artembannikov@users.noreply.github.com>
2023-11-27 14:28:18 +01:00
Pavel Busko
0baa6a6fcb
feat(cnbBuild): Use Paketo Jammy builder as default (#4694) 2023-11-23 13:37:19 +01:00
Googlom
a838f485d7
add alias to serverUrl (#4670)
Co-authored-by: Gulom Alimov <gulomjon.alimov@sap.com>
2023-11-20 11:11:54 +01:00
Jk1484
f2b236c537
feat(npmExecuteScripts): added option to skip installing dev. deps. (#4660)
* feat(npmExecuteScripts): added option to skip installing dev. deps.

* added unit tests

* setting of OpenFile function for local testing

---------

Co-authored-by: Anil Keshav <anil.keshav@sap.com>
2023-11-10 11:04:00 +01:00
Anil Keshav
ef9b3d0dc9
feat (mavenBuild) allow flags to be modified during maven deploy (#4638)
* allow flags to be modified during maven deploy

* fix unit test

* fix unit test 2
2023-11-08 00:25:16 +01:00
Manjunath
ae7bfa5d92
Include createBOM flag in MTA build (#4629)
* Include createBOM flag in MTA build

* Uncomment bom creation

* Changed sbom path

* Changed source path

* Reverted source path and included folder path to bom

* Test docker image

* Test docker image

* sbom name change

* Removed the redundent log
2023-11-07 09:16:10 +01:00
Pavel Busko
26bfec19b3
feat(cnbBuild): support builders with different CNB user ids (#4625)
Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
2023-11-02 16:03:11 +01:00
Daria Kuznetsova
6331d1b839
feat(codeqlExecuteScan): cloning project from non-github scm to github #4630
Co-authored-by: sumeet patil <sumeet.patil@sap.com>
2023-10-18 16:50:15 +05:30
Vyacheslav Starostin
3761a9f68a
artifactPrepareVersion: support conditions for customTLSCertificateLinks parameter (#4631)
* Add conditions for customTlsCertificateLinks

* go generate
2023-10-16 17:56:59 +06:00
Vyacheslav Starostin
14c7feba1c
feat(artifactPrepareVersion): Support custom certificates (#4617)
* Add CertificateDownload func to certutils package

* Add customTlsCertificateLinks param for artifactPrepareVersion

* Add the possibility to provide custom certs for artifactPrepareVersion

* Update tests

* Return back build flags

* Return back build flags

* Update pkg/certutils/certutils.go

Apply suggestion from code review

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>

---------

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2023-10-11 13:58:38 +06:00
Vyacheslav Starostin
7ab2386337
feat(mavenBuild): add the possibility to define stash groups need to be stashed/unstashed (#4573)
* Add stash param to mavenBuild

* go generate

* Delete default stash group

---------

Co-authored-by: Anil Keshav <anil.keshav@sap.com>
2023-10-09 15:52:13 +06:00
Anil Keshav
40e13f1635
feat (npmExecuteScripts) enhance multi package publish from npm builds (#4579)
* enabling publish to only publish sub packages

* changing directory and then coming back to original after the publish runs

* searching the glob tar and npmrc in the current directory

* excluding build descriptor check and addtional target tool check

* changing the npm pack before publish to run only in sub packages

* removing commented code clean up

* adding the correct npm pack

* improve logging

* fix error handling and a bit style fix

* fix unit tests

* remove commented lines

* respecting build descriptor list when provided

* improve docu for the step param

* fixing linting issues

* improve docu

---------

Co-authored-by: Gulom Alimov <gulomjon.alimov@sap.com>
Co-authored-by: Jordi van Liempt <35920075+jliempt@users.noreply.github.com>
2023-10-09 09:21:09 +02:00
Akramdzhon Azamov
9e64744339
added logic of fetching golang private packages for whitesource step (#4595)
* added logic of fetching golang private packages for whitesource step and detectExecuteScan step

* changed logic of checking by config.PrivateModulesGitToken

* moved func prepareGolangPrivatePackages to golangBuild.go

* fix (gitOpsUpdateDeployment) add CA bundle options to plain clone and commit to trust enterprise github instances (#4602)

* downloading ca cert bundle when added as config

* adding logging statements

* allowing bats test to handle ca cert

* adding info message

* hard coding file names

* including correct http client util bundle

* removing logging message not needed

* adding cert bundle to commit and push

* improving the condition to add ca cert in commit and push

* fixing unit test

* fixing unit test

* fixing unit test

* fixing unit test

* fixing unit test

* feat(kanikoExecute): add dockerfilePath param to multipleImages (#4569)

* add containerDockerfilePath param to multipleImages

* rename ContainerDockerfilePath param to DockerfilePath

* Fix trailing spaces

---------

Co-authored-by: Egor Balakin <egor.balakin@sap.com>
Co-authored-by: Vyacheslav Starostin <32613074+vstarostin@users.noreply.github.com>

* fix(helm): forward sourceRepositoryCredentialsId from groovy to go layer (#4604)

forward sourceRepositoryCredentialsId from groovy to go layer in the same way how this is done for the targetRepositoryCredentialsId

* feat(config): exporting generateConfig function and applying minor changes (#4605)

* exporting generateConfig function and applying minor changes

* Added setConfigOptions to set configOptions variable.
Added possibility to set format output, json or yaml for now.

* Correcting mistake on cmd/getDefaults.go

Co-authored-by: Jordi van Liempt <35920075+jliempt@users.noreply.github.com>

---------

Co-authored-by: Jordi van Liempt <35920075+jliempt@users.noreply.github.com>

* moved func prepareGolangPrivatePackages to pkg/golang

---------

Co-authored-by: Akramdzhon Azamov <MY_NAME@example.com>
Co-authored-by: Andrei Kireev <andrei.kireev@sap.com>
Co-authored-by: Anil Keshav <anil.keshav@sap.com>
Co-authored-by: Egor Balakin <14162703+m1ron0xFF@users.noreply.github.com>
Co-authored-by: Egor Balakin <egor.balakin@sap.com>
Co-authored-by: Vyacheslav Starostin <32613074+vstarostin@users.noreply.github.com>
Co-authored-by: Marcus Holl <marcus.holl@sap.com>
Co-authored-by: Jk1484 <35270240+Jk1484@users.noreply.github.com>
Co-authored-by: Jordi van Liempt <35920075+jliempt@users.noreply.github.com>
2023-10-06 16:22:26 +02:00
Marcus Holl
c81e322986
fix(helm): forward sourceRepositoryCredentialsId from groovy to go layer (#4604)
forward sourceRepositoryCredentialsId from groovy to go layer in the same way how this is done for the targetRepositoryCredentialsId
2023-09-29 13:59:56 +02:00
Egor Balakin
4dec3c3c60
feat(kanikoExecute): add dockerfilePath param to multipleImages (#4569)
* add containerDockerfilePath param to multipleImages

* rename ContainerDockerfilePath param to DockerfilePath

* Fix trailing spaces

---------

Co-authored-by: Egor Balakin <egor.balakin@sap.com>
Co-authored-by: Vyacheslav Starostin <32613074+vstarostin@users.noreply.github.com>
2023-09-28 14:14:35 +02:00
Anil Keshav
b34ea9e335
fix (gitOpsUpdateDeployment) add CA bundle options to plain clone and commit to trust enterprise github instances (#4602)
* downloading ca cert bundle when added as config

* adding logging statements

* allowing bats test to handle ca cert

* adding info message

* hard coding file names

* including correct http client util bundle

* removing logging message not needed

* adding cert bundle to commit and push

* improving the condition to add ca cert in commit and push

* fixing unit test

* fixing unit test

* fixing unit test

* fixing unit test

* fixing unit test
2023-09-28 11:31:51 +02:00
Dmitrii Pavlukhin
971d5d1461
Making detect8 default script (#4568)
* made detect8 default

* amended tests to reflect detect 8

* amended

* amend

* amend

* amend tests

* 1

* 1

* tests-with-temp-changes-for-transition

* removed auto unmapping for detect7

* added-old-parameters-as-deprecated
2023-09-18 16:33:09 +03:00
Marcus Holl
e80adc5ab9
helmExecute: opt out from template parsing (#4511)
Add option to opt out from helm template parsing

Co-authored-by: Linda Siebert <linda.siebert@sap.com>
Co-authored-by: Alexander Link <33052602+alxsap@users.noreply.github.com>
2023-09-08 10:30:30 +02:00
Linda Siebert
b58bb87114
Set chartPath to general for kubernetesDeploy (#4537) 2023-09-07 11:36:59 +02:00
michaelkubiaczyk
bc8d5efe46
Cxone release supporting applications (#4548)
* Initial in progress

* compiling but not yet functional

* Missed file

* updated checkmarxone step

* Working up to fetching a project then breaks

* Missed file

* Breaks when retrieving projects+proxy set

* Create project & run scan working, now polling

* Fixed polling

* added back the zipfile remove command

* Fixed polling again

* Generates and downloads PDF report

* Updated and working, prep for refactor

* Added compliance steps

* Cleanup, reporting, added groovy connector

* fixed groovy file

* checkmarxone to checkmarxOne

* checkmarxone to checkmarxOne

* split credentials (id+secret, apikey), renamed pullrequestname to branch, groovy fix

* Fixed filenames & yaml

* missed the metadata_generated.go

* added json to sarif conversion

* fix:type in new checkmarxone package

* fix:type in new checkmarxone package

* removed test logs, added temp error log for creds

* extra debugging to fix crash

* improved auth logging, fixed query parse issue

* fixed bug with group fetch when using oauth user

* CWE can be -1 if not defined, can't be uint

* Query also had CweID

* Disabled predicates-fetch in sarif generation

* Removing leftover info log message

* Better error handling

* fixed default preset configuration

* removing .bat files - sorry

* Cleanup per initial review

* refactoring per Gist, fixed project find, add apps

* small fix - sorry for commit noise while testing

* Fixing issues with incremental scans.

* removing maxretries

* Updated per PR feedback, further changes todo toda

* JSON Report changes and reporting cleanup

* removing .bat (again?)

* adding docs, groovy unit test, linter fixes

* Started adding tests maybe 15% covered

* fix(checkmarxOne): test cases for pkg and reporting

* fix(checkmarxOne):fix formatting

* feat(checkmarxone): update interface with missing method

* feat(checkmarxone):change runStep signature to be able to inject dependency

* feat(checkmarxone): add tests for step (wip)

* Adding a bit more coverage

* feat(checkmarxOne): fix code review

* feat(checkmarxOne): fix code review

* feat(checkmarxOne): fix code review

* feat(checkmarxOne): fix integration test PR

* adding scan-summary bug workaround, reportgen fail

* enforceThresholds fix when no results passed in

* fixed gap when preset empty in yaml & project conf

* fixed another gap in preset selection

* fix 0-result panic

* fail when no preset is set anywhere

* removed comment

* initial project-under-app support

* fixing sarif reportgen

* some cleanup of error messages

* post-merge test fixes

* revert previous upstream merge

* fix:formatting

* fix(checkmarxOne):yamllint too many blank lines

* fix(checkmarxOne):unit test

* fix(checkmarxOne):generated code

---------

Co-authored-by: thtri <trinhthanhhai@gmail.com>
Co-authored-by: Thanh-Hai Trinh <thanh.hai.trinh@sap.com>
2023-09-05 21:49:27 +02:00
Dmitrii Pavlukhin
0f04b5f6e1
added detect8 support (#4545) 2023-09-01 15:25:37 +03:00
sumeet patil
f6e6d04408
feat(fortifyExecuteScan): Fortify proxy parameter (#4543) 2023-08-31 17:18:18 +05:30
Marcus Holl
d6d3b6b091
helmExecute triggered by buildExecute (#4521) 2023-08-21 11:10:00 +02:00
Egor Balakin
9189ab37b5
remove STAGES scope from kanikoExecute.multipleImages param (#4508)
Co-authored-by: Egor Balakin <egor.balakin@sap.com>
2023-08-11 13:31:53 +04:00
Egor Balakin
e2bf31872b
kanikoExecute: add multiple build (#4461)
* kanikoExecute: add MultipleImages option

---------

Co-authored-by: Egor Balakin <egor.balakin@sap.com>
2023-08-07 16:58:59 +04:00
sumeet patil
08d22a62e2
fix(checkmarxOne): added missing report (#4482)
* fix(checkmarxOne): added missing report

* added missing files after go generate
2023-07-27 09:35:54 +02:00
thtri
c339f32d97
fix(checkmarxOne): changed json report (#4478)
* fix(checkmarxOne): changed json report
2023-07-21 10:16:25 +05:30
Akramdzhon Azamov
b703995917
feat(detectExecuteScan): deprecating parameter scanOnChanges (#4473)
Co-authored-by: sumeet patil <sumeet.patil@sap.com>
2023-07-19 15:25:17 +05:30
Daria Kuznetsova
96f5508c8a
fix(codeqlExecuteScan): moved flag checkIfCompliance (#4443)
* moved checkForCompliance flag, updated description of sarif check params

* added generated codeqlExecuteScan

* moved appending reports before checking for compliance

---------

Co-authored-by: sumeet patil <sumeet.patil@sap.com>
2023-07-11 22:02:54 +05:30
Pavel Busko
610e212306
feat(cnbBuild) Add support for pre and post-buildpacks (#4448)
* Add pre and post buildpacks

Co-authored-by: Johannes Dillmann <j.dillmann@sap.com>
Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
Co-authored-by: Pavel Busko <pavel.busko@sap.com>

* fix integration tests

Co-authored-by: Pavel Busko <pavel.busko@sap.com>
Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>

* simplify if clauses

Co-authored-by: Pavel Busko <pavel.busko@sap.com>

---------

Co-authored-by: Johannes Dillmann <j.dillmann@sap.com>
Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
2023-07-06 11:34:05 +02:00
Pavel Busko
13f1e94ade
fix(cnbBuild): read dockerConfigJSON from CPE and merge it with user-provided (#4444)
Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
2023-07-04 14:19:02 +02:00
Pavel Busko
d8dacda121
feat(cnbBuild): support setting registry username and password via parameters (#4426)
* feat(cnbBuild): support setting registry username and password via parameters

* fix gitops integration test assertion

Co-authored-by: Pavel Busko <pavel.busko@sap.com>

* Update integration/integration_gitops_test.go

---------

Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
2023-06-30 12:02:35 +00:00
Jk1484
30d82e920d
fix(kaniko): Update documentation (#4405)
* replacing mandatory if to mandatory.

* Revert "replacing mandatory if to mandatory."

This reverts commit f98ab5f0ff.

* Update documentation

* go generate

* Update documentation

* go generate

---------

Co-authored-by: Ashly Mathew <ashly.mathew@sap.com>
Co-authored-by: Vyacheslav Starostin <vyacheslav.starostin@sap.com>
2023-06-29 14:11:34 +06:00
Daria Kuznetsova
6eb4c2e72d
fix(codeqlExecuteScan): added waiting for the SARIF file upload (#4409)
* added waiting for the sarif file uploaded & tests

* increased polling time, added timeout for waiting response from server & tests

* fixed handling error while waiting sarif uploaded

* added params for checking sarif uploaded & refactor

* added test logs

* fixed logs and test

* added returning missed error

* changed params descriptions and server response error processing processing

* fixed retrying logic

* increased polling timeout params & refactored
2023-06-20 15:50:28 +03:00
Marcus Holl
8b36ae70e7
Adjust npmExecuteLint (output-format, print output to console) (#4407)
* Adjust npmExecuteLint (output-format, print output to console)

Co-authored-by: Srinikitha Kondreddy <srinikitha.kondreddy@sap.com>
2023-06-19 12:04:37 +02:00
Anil Keshav
39d52a2123
feat (protecodeExecuteScan) enhancing protecode step with registry credentials (#4378)
* enhancing protecode with registry credentials

* Use protecodeUtils instead of separate package

* Add target path for docker config to be created

* Fix tests

* Fix build flags

---------

Co-authored-by: Vyacheslav Starostin <vyacheslav.starostin@sap.com>
2023-06-14 09:11:33 +02:00
sumeet patil
416cb1d327
fix(codeqlExecuteScan): added report file to output resources (#4388) 2023-06-02 18:31:52 +05:30
Leonard Heilos
c15448b4e0
feat(whitesourceExecuteScan): allow to specify InstallCommand (#4376)
* feat(whitesourceExecuteScan) allow to specify InstallCommand

* reorder imports

---------

Co-authored-by: sumeet patil <sumeet.patil@sap.com>
Co-authored-by: Andrei Kireev <andrei.kireev@sap.com>
2023-05-30 16:00:02 +02:00
thtri
5ab432b804
fix(whitesource):add stash for checkmarxOne (#4383) 2023-05-30 11:06:14 +02:00
sumeet patil
1c018dbff7
feat(codeqlExecuteScan) : auto fill api url (#4369) 2023-05-22 19:59:43 +05:30
Srinikitha Kondreddy
a76b20f09f
Upgrade sonar scanner cli image version to 4.8 (#4362)
* Uprade sonar scanner cli version to 4.8

* Update download url
2023-05-17 09:24:27 +02:00