1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00
Commit Graph

915 Commits

Author SHA1 Message Date
Christopher Fenner
669dc91688
fix: prevent script to json conversion (#1495)
* prevent script to json conversion

* use piperExecuteBin

* correct imports

* fix trailing spaces
2020-05-05 15:21:59 +02:00
Christopher Fenner
d75dced2a6
test: activate common test cases using piperExecuteBin (#1501) 2020-05-05 14:31:12 +02:00
Marcus Holl
30850aec2d
Add groovy wrapper for malwarescanning (#1403) 2020-04-30 11:14:14 +02:00
Oliver Nocon
3f1a9d004a
Allow proper usage of resilience feature in golang steps (#1487)
* Allow proper usage of resilience feature in golang steps
2020-04-30 10:39:27 +02:00
Oliver Nocon
43947e6ef5
Pass golang error details to Jenkins pipeline (#1443)
Do not exit with os.Exit(1) but using log.Entry().Fatal() instead
* Golang: forward error details
* extend groovy wrapper to provide proper error message
* create closure for error handling
2020-04-28 07:42:02 +02:00
Oliver Nocon
b9450702af
piperExecuteBin: fix reading environment (#1452)
* piperExecuteBin: fix reading environment
* update tests

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2020-04-24 22:41:34 +02:00
Florian Wilhelm
3f5b9cc555
Implement npmExecuteScripts step (#1422) 2020-04-24 18:29:30 +02:00
Chris Bo
fb4cfd84ec
Introducing new step: "gctsCreateRepository" (#1424)
With the step gctsCreateRepository it is possible to create a local gCTS repository on an ABAP server

Co-authored-by: Marcus Holl <marcus.holl@sap.com>
2020-04-24 15:31:41 +02:00
Daniel Kurzynski
974327d16e
Use mavenExecute from go (#1388)
Also establish mavenExecute() via new JenkinsMavenExecuteRule in Groovy Unit Tests.

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-04-24 10:41:49 +02:00
artembannikov
8206fb9716
TMS: Print response content for status codes 3xx in addition to 4xx and 5xx (#1441)
* Extend JenkinsLoggingRule and TransportManagementServiceTest

* Print response content for status codes >= 300, also test that it's not
revealed in the case of unexpected status codes between 200 and 300
(both not included) for authentication

Co-authored-by: Marcus Holl <marcus.holl@sap.com>
2020-04-23 09:46:25 +02:00
Oliver Nocon
067eb0ba6a
Improve error messages for test failures (#1417) 2020-04-17 11:59:51 +02:00
Daniel Kurzynski
1c247de9d0
Add option to always run stages in a pod (#1414) 2020-04-17 10:31:04 +02:00
Oliver Nocon
4061881b53
UIVeri5 & Newman: provide better error messages (#1410) 2020-04-16 09:14:39 +02:00
Oliver Nocon
bd0eed30ff
stageWrapper: new error handling (#1401)
* handlePipelineStepErrors: allow disabling for stages
* update error handling in stages
* move file loading into try catch
* Cleanup DebugReport before test

Apparantly, the same DebugReport instance is loaded
during all Unit Tests. Avoid left-overs from previous
tests.

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2020-04-15 14:02:41 +02:00
Daniel Kurzynski
b32214ee78
Inherit from Kubernetes pod template (#1361) 2020-04-08 19:54:06 +02:00
Christopher Fenner
c190deee44
refactor(sonar): switch to Sonar scan in GO (#1320)
* use sonar go in groovy

* use SONAR_TOKEN

* only use owner/repo if both are set

* trim version to major version digit

* fix code climate issues

* remove Sonar defaults

* use sonar go step

* use SONAR_TOKEN

* use certs from parameters

* use docker workspace & options

* add instance parameter

* implement branchName

* implement branchName

* remove duplicate default

* update docs

* fix TODOs

* remove merge mess

* fix code climate issue

* address comments

* respect custom defaults and custom config file name

* fix typo

* remove obsolete test cases

* disable CommonStepChecks

* check step config instead of context config

* remove TODOs

* respect jenkins PR envvars

* use value from stepConfig

* Update vars/sonarExecuteScan.groovy

* rename options to config

* correct type for options

* add test cases

* log sonar.options in debug message

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-04-08 12:55:46 +02:00
artembannikov
4553c8f278
TMS: explicitly check in tests that there is no token in the logs (#1370)
* Check in the tests explicitly that token is not present in logs

* Address feedback

Co-authored-by: Marcus Holl <marcus.holl@sap.com>
2020-04-07 15:42:38 +02:00
artembannikov
20a8d3b656
Exchange dummy(.)com in tests with a more secure URL (#1371)
Co-authored-by: Marcus Holl <marcus.holl@sap.com>
2020-04-07 14:52:27 +02:00
chrisfries
5c1be118a3
fix: fixing issues with cf docker deployment (#1289) 2020-04-07 09:10:38 +02:00
artembannikov
26feb014df
TMS: implement response processing based on its HTTP response code for authentication and uploadFileToNode (#1335)
* Expose error message if status is not 200, extend junit tests

* Address feedback

Co-authored-by: Marcus Holl <marcus.holl@sap.com>
2020-04-06 11:29:18 +02:00
Marcus Holl
4b93dc5db7
Provide response from tms file upload also in case of rc outside 2xx (#1297)
* Provide response from tms file upload also in case of return codes outside 2xx

* Update src/com/sap/piper/integration/TransportManagementService.groovy

Co-Authored-By: Oliver Feldmann <oliver.feldmann@sap.com>

* Update src/com/sap/piper/integration/TransportManagementService.groovy

Co-Authored-By: Oliver Feldmann <oliver.feldmann@sap.com>

* consider re-running in verbose mode only if we are not in verbose mode

* Add missing script reference when calling error

* avoid curl --fail in order to get also a response in case of 4xx 5xx

* add missing write-out

* --output instead of -o

* fix syntax errors

* fix codeclimat issue

* fix unit tests /1

* Adjust unit tests

* More unit tests

* Use other texts in verbose mode and non verbose mode in case of a failure

in order to avoid issue with hanging log messages surviving a test case (... should not be the case).

For the non verbose mode we check the http response code since there is not message we can check.

* Now with the full comment explaining the 418

* Provide different responses for verbose and non-verbose mode

in order to distinguish the cases

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>
2020-04-06 10:13:10 +02:00
Stephan Aßmus
ded6152b56
nexusUpload: Remove config processing from Groovy layer (#1364) 2020-04-04 11:44:02 +02:00
Florian Geckeler
5e35869f7c
Use stable version for setting maven version (#1332) 2020-04-03 18:16:58 +02:00
Oliver Nocon
999197b919
Add step to prepare the version for an artifact (#1343) 2020-04-03 16:34:40 +02:00
Daniel Kurzynski
ea007c0d1f
Fix test by resetting application context after each test (#1352) 2020-04-01 11:51:20 +02:00
Dominik Lendle
5fba815fe8
Transformation of cfCreateServiceKey to Golang (#1253) 2020-04-01 11:45:31 +02:00
Marcus Holl
67e984addc
Dont expose token during tms auth request (#1294)
* [refactoring] return the http response from sendApiRequest

* Don't expose token after authentification request

* Update src/com/sap/piper/integration/TransportManagementService.groovy

Co-Authored-By: arktiker <45875324+arktiker@users.noreply.github.com>

* provide return keyword - it is better to understand ...

* fix assert log message

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>
Co-authored-by: arktiker <45875324+arktiker@users.noreply.github.com>
2020-04-01 08:55:17 +02:00
Stephan Aßmus
0b8b6f2b0c
Migrate stage artifact deployment from Cloud SDK Pipeline-Lib (#1324)
Co-authored-by: Daniel Kurzynski <daniel.kurzynski@sap.com>
Co-authored-by: Florian Geckeler <f.geckeler@sap.com>
2020-03-31 15:16:18 +02:00
Srinikitha Kondreddy
27286deb59
Add env variable to control execution of extensions in project repo. (#1326)
* Introduce new env variable to restrict extension files exec

* Add docu on restricting exec of extension files

* Update documentation/docs/extensibility.md

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

* Rename parameter

* Update documentation/docs/extensibility.md

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

* Add test for restricting extensions exec

* Fix additional tests

* extract condition

* use binding for env vars

* mock env binding

* Update piperStageWrapper.groovy

🙄

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
Co-authored-by: Marcus Holl <marcus.holl@sap.com>
2020-03-31 12:51:34 +02:00
Marcus Holl
afa96cb8c0
Assert a command is the latest one instead expecting it at a certain index (#1344)
Co-authored-by: Florian Geckeler <43751896+fgeckeler@users.noreply.github.com>
2020-03-31 12:19:05 +02:00
Florian Geckeler
bd92804745
Add static code checks stage (#1308)
* Add static code checks stage
* Rework go step to accept thresholds for the checks and fail maven build if above the thresholds
2020-03-30 15:59:59 +02:00
Daniel Kurzynski
9ed39cfa3f
Maven build groovy (#1303) 2020-03-23 09:58:54 +01:00
Stephan Aßmus
20b65d5a2e
Implement nexusUpload command and tests (#1255)
Artifacts to upload are assembled for MTA projects and Maven projects with optional application sub-module. Then maven deploy:deploy-file is used as backend to upload bundles of artifacts plus sub-artifacts.

Co-authored-by: Florian Wilhelm <florian.wilhelm02@sap.com>
2020-03-20 18:20:52 +01:00
Florian Geckeler
b39080409c
Add DownloadCacheUtils for handling download cache docker container (#1298) 2020-03-20 17:01:20 +01:00
Daniel Kurzynski
6bd259e5d4
Fix sidecar env vars (#1292) 2020-03-20 11:36:16 +01:00
Oliver Nocon
289bb58e66
Fix issue with pipeline resilience (#1288)
closes #1286 which was introduced with #1146
2020-03-18 08:32:28 +01:00
Oliver Nocon
a49d8947c0
Streamline calling piper go binary (#1254) 2020-03-17 09:19:09 +01:00
Christopher Fenner
a970507619
refactor(sonar): provide trust store via JVM parameter (#1270)
* provide trust store via JVM parameter

* adjust test cases

* Update vars/sonarExecuteScan.groovy

* Update vars/sonarExecuteScan.groovy

* Update sonarExecuteScan.groovy
2020-03-16 10:34:07 +01:00
Florian Geckeler
9a28e12d5d
Add groovy wrapper for mavenExecuteStaticCodeChecks and rename go step 2020-03-12 15:45:57 +01:00
Christopher Fenner
2b2b57305e
fix: handle NPE in seleniumExecuteTests (#1239)
* handle NPE

* fix Code Climate issue

* add test case

Co-Authored-By: Maximilian Lenkeit <mlenkeit@users.noreply.github.com>

* correct test case

Co-authored-by: Maximilian Lenkeit <mlenkeit@users.noreply.github.com>
2020-03-03 17:09:09 +01:00
Florian Geckeler
d32e6402b0
Add GetTestModulesExcludes to pkg/maven (#1237) 2020-03-02 17:04:49 +01:00
René Kschamer
d754a669b2
Add Docker deploy support to cloudFoundryDeploy (#977)
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
Co-authored-by: Daniel Kurzynski <daniel.kurzynski@sap.com>
2020-02-25 10:20:15 +01:00
Srinikitha Kondreddy
38237eb97b
Update mta yaml file to support cloud MBT mtar deploy to neo. (#1198)
* Update schema and hcp deployer version in mta.yaml file

* Add name parameter in mta yaml file

* Rename template_mta.yml to template_mta.yaml

* Fix indentation

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>
Co-authored-by: Marcus Holl <marcus.holl@sap.com>
2020-02-20 14:57:50 +01:00
Maximilian Lenkeit
fa4938e590
seleniumExecuteTests: expose only required metadata (#1179) 2020-02-19 11:21:11 +01:00
Oliver Nocon
fd76f721ea
Streamline implementation githubPublishRelease (#1191) 2020-02-19 09:05:53 +01:00
Maximilian Lenkeit
973a47d3b2
Add support for Selenium Hub credentials (#1171)
* add parameter for selenium hub credentials

* align selenium hub parameter names

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-02-17 14:34:19 +01:00
Christopher Fenner
87f0cb687a
refactor(deployment): ease debugging in blue ocean (#1173)
* Update cloudFoundryDeploy.groovy

fixes #857

* Update cloudFoundryDeploy.groovy

* Update neoDeploy.groovy

* fix typo

* Update cloudFoundryDeploy.groovy

* Update cloudFoundryDeploy.groovy

* adjust test cases
2020-02-14 13:41:36 +01:00
FrittenToni
0d82a39098
Ignore email addresses containing string "noreply" (#1178)
* avoid sending mails to addresses which contain the string noreply

* enrich test to ensure that mails containing the string noreply never end up in recipient list

* Update MailSendNotificationTest.groovy
2020-02-13 15:12:48 +01:00
Maximilian Lenkeit
00b094d74b
seleniumExecuteTests: expose container metadata via env vars (#1170)
* inject container metadata via env vars to selenium

* set step-specific env var for uiVeri55ExecuteTests

* Revert "set step-specific env var for uiVeri55ExecuteTests"

This reverts commit 8deb39ac5b.

* remove env vars that indicate piper step

* remove env var to indicate execution through selenium step

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

* remove defaulting of docker env vars

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

* Update vars/karmaExecuteTests.groovy

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

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-02-13 09:09:08 +01:00
Oliver Nocon
321f8fbbc1
More resilient handling of download errors for piper bin (#1147)
* fix #1114
* Update test/groovy/com/sap/piper/PiperGoUtilsTest.groovy
* add log output
2020-02-12 09:02:39 +01:00