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

494 Commits

Author SHA1 Message Date
Fabian Reh
0bfc582808
simplify parameters
Signed-off-by: Fabian Reh <fabian.reh@sap.com>
2021-04-07 10:11:17 +02:00
Fabian Reh
51ac8bc3d3
Refactor zipFolder method to reduce complexity
Signed-off-by: Fabian Reh <fabian.reh@sap.com>
2021-04-07 09:10:54 +02:00
Fabian Reh
175263920e
Add tests and error handling for PathMatch
Signed-off-by: Fabian Reh <fabian.reh@sap.com>
2021-04-07 07:59:39 +02:00
Fabian Reh
13f504b75d
Add tests and error handling for write file
Signed-off-by: Fabian Reh <fabian.reh@sap.com>
2021-04-06 16:40:33 +02:00
Fabian Reh
cc1e8530d9
Add tests and error handling for write file
Signed-off-by: Fabian Reh <fabian.reh@sap.com>
2021-04-06 16:30:29 +02:00
Fabian Reh
e290cf7e89
Add tests and error handling for string conversion and zip file
Signed-off-by: Fabian Reh <fabian.reh@sap.com>
2021-04-06 15:47:12 +02:00
Fabian Reh
42d93d78cc
Merge branch 'master' into fixCheckmarxExecuteScan 2021-04-06 14:08:14 +02:00
Giridhar Shenoy
97b3a23336
HotFix detectExecuteScan: Use environment variables to get supported version of detect (#2738)
* changes to detectExec before master merge

* changes for detectExecuteScan

* self generated code added

* fix syntax errors and update docu

* added unit tests for fail and Group

* fix failOn bug

* add Groups as string array

* add Groups as string array

* tests and validation for groups, failOn

* Updated docs and added more tests

* documentation md files should not be changed

* Handle merge conflicts from PR 1845

* fix merge errors

* remove duplicate groups, merge error

* adding buildCode and buildTool as params

* switching build options

* building maven modules

* parameter correction

* parameter correction

* gnerate with new build parameter

* adding comments

* removing piper lib master and modifying goUtils to download 1.5.7 release

* first cleaning then installing

* multi module maven built

* multi module maven built removing unwanted code

* multi module maven built moving inside switch

* testing

* modifying the default use case to also call maven build

* modifying the default use case to also call maven build wih --

* corrected maven build command

* corrected maven build command with %v

* skipping test runs

* testing for MTA project with single pom

* adding absolute path to m2 path

* clean up

* adding switch for mta and maven and removing env from containers

* commiting changes for new detect step

* correting log message

* code clean up

* unit tests changes to detectExecute

* basic tests for new change

* restoring piperGoUtils to download correct piper binary

* code clean up

* code clean up

* clean detect code version

* Changes for detect codelocation

* remove unmap from scanProperties

* fix/add unit tests for remove unmap

* handle spaces in scanProperties

* update default scanproperties to remove deprecations

* Set default scanonchange to true

* handle multiple unmap true params

* add custom env variables

* fix codeclimate issues

* Update resources/metadata/detect.yaml

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

* Update resources/metadata/detect.yaml

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

* update generated files from yaml

Co-authored-by: Keshav <anil.keshav@sap.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2021-04-01 11:24:25 +02:00
Oliver Nocon
d59864530a
feat(kaniko) allow Docker config to be passed via cpe (#2734)
* feat(kaniko) allow Docker config to be passed via cpe

* update generated files
2021-04-01 09:47:24 +02:00
Giridhar Shenoy
6805654cdb
detectExecuteScan : Default to scanOnChanges to true, reduce load on the server (#2733)
* changes to detectExec before master merge

* changes for detectExecuteScan

* self generated code added

* fix syntax errors and update docu

* added unit tests for fail and Group

* fix failOn bug

* add Groups as string array

* add Groups as string array

* tests and validation for groups, failOn

* Updated docs and added more tests

* documentation md files should not be changed

* Handle merge conflicts from PR 1845

* fix merge errors

* remove duplicate groups, merge error

* adding buildCode and buildTool as params

* switching build options

* building maven modules

* parameter correction

* parameter correction

* gnerate with new build parameter

* adding comments

* removing piper lib master and modifying goUtils to download 1.5.7 release

* first cleaning then installing

* multi module maven built

* multi module maven built removing unwanted code

* multi module maven built moving inside switch

* testing

* modifying the default use case to also call maven build

* modifying the default use case to also call maven build wih --

* corrected maven build command

* corrected maven build command with %v

* skipping test runs

* testing for MTA project with single pom

* adding absolute path to m2 path

* clean up

* adding switch for mta and maven and removing env from containers

* commiting changes for new detect step

* correting log message

* code clean up

* unit tests changes to detectExecute

* basic tests for new change

* restoring piperGoUtils to download correct piper binary

* code clean up

* code clean up

* clean detect code version

* Changes for detect codelocation

* remove unmap from scanProperties

* fix/add unit tests for remove unmap

* handle spaces in scanProperties

* update default scanproperties to remove deprecations

* Set default scanonchange to true

* handle multiple unmap true params

Co-authored-by: Keshav <anil.keshav@sap.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-03-31 10:53:49 +02:00
lndrschlz
c303616fee
fix(newmanExecute): extend error categorization (#2705)
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2021-03-31 10:09:27 +02:00
Kevin Stiehl
fe6ea643fa
Add terraformExecuteStep (#2679)
* Add terraformExectueStep

* Update terraformExecute.go

* fmt

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-03-29 16:22:23 +02:00
Giridhar Shenoy
03f46ef90c
DetectExecuteScan : Codelocations autodetermined by detect script (#2704)
* changes to detectExec before master merge

* changes for detectExecuteScan

* self generated code added

* fix syntax errors and update docu

* added unit tests for fail and Group

* fix failOn bug

* add Groups as string array

* add Groups as string array

* tests and validation for groups, failOn

* Updated docs and added more tests

* documentation md files should not be changed

* Handle merge conflicts from PR 1845

* fix merge errors

* remove duplicate groups, merge error

* adding buildCode and buildTool as params

* switching build options

* building maven modules

* parameter correction

* parameter correction

* gnerate with new build parameter

* adding comments

* removing piper lib master and modifying goUtils to download 1.5.7 release

* first cleaning then installing

* multi module maven built

* multi module maven built removing unwanted code

* multi module maven built moving inside switch

* testing

* modifying the default use case to also call maven build

* modifying the default use case to also call maven build wih --

* corrected maven build command

* corrected maven build command with %v

* skipping test runs

* testing for MTA project with single pom

* adding absolute path to m2 path

* clean up

* adding switch for mta and maven and removing env from containers

* commiting changes for new detect step

* correting log message

* code clean up

* unit tests changes to detectExecute

* basic tests for new change

* restoring piperGoUtils to download correct piper binary

* code clean up

* code clean up

* clean detect code version

* Changes for detect codelocation

* remove unmap from scanProperties

* fix/add unit tests for remove unmap

* handle spaces in scanProperties

* update default scanproperties to remove deprecations

Co-authored-by: Keshav <anil.keshav@sap.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-03-26 13:06:13 +01:00
Srinikitha Kondreddy
95ebfb3b2f
Make cert updates optional based on param value (#2722) 2021-03-25 15:32:10 +01:00
Srinikitha Kondreddy
24dd9b5cec
Set some params optional for deployTool: kubectl (#2708)
* Set some params optional for deployTool: kubectl

* Add test case

* Add test case for code coverrge

* Add code review changes

* Code review changes
2021-03-25 12:26:44 +01:00
Sven Merk
03b5a9aaec
Fix handling of undefined buildTool values (#2719)
* Fix handling of undefined buildTool values

* Fix fmt
2021-03-25 09:59:49 +01:00
Siarhei Pazdniakou
33699c7388
Convert containerExecuteStructureTests to go implementation (#2701)
* Converted containerExecuteStructureTests to go implementation

* Added tests

* Fixed issues

* Made fixes

Co-authored-by: lndrschlz <leander.schulz01@sap.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-03-25 08:18:30 +01:00
Sven Merk
dfe9cb6149
Add capability for yarn scanning (#2716)
* Add capability for yarn scanning

* Update whitesource.yaml

* Update configHelper.go

* Add newly generated impl
2021-03-24 16:33:32 +01:00
Oliver Nocon
c038a3b08a
fix(whitesourceExecuteScan) properly pass verbose setting (#2713)
* fix(whitesourceExecuteScan) properly pass verbose setting

* check within piper binary

Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2021-03-23 12:06:23 +01:00
Roland Stengel
101e8ec784
TransportRequest: add UploadSOLMAN groovy step (#2688)
* TransportRequest: add UploadSOLMAN groovy step
- groovy to go
- use docker image in go
- map credentials in go
- generated yaml
2021-03-22 11:53:37 +01:00
Oliver Nocon
2b11c09a8c
feat(githubCreateIssue): allow content via file (#2557) 2021-03-19 13:04:30 +01:00
Oliver Nocon
9b6a8cb3b6
feat(whitesource): create json report (#2699)
* feat(withesource): create json report

* proper constant value

* update generation
2021-03-19 11:10:08 +01:00
Oliver Nocon
2048c00d2c
whitesource: use only Unified Agent for scanning (#2707)
don't use native build-tool specific plugins any longer.
They have been deprecated by WhiteSource mid 2019 already.

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2021-03-19 09:58:24 +01:00
Roland Stengel
d79295a30f
add common pipeline environment persistency to solman upload (#2659)
* add common pipeline environment
- cpe/custom/ChangeDocumentId
- cpe/custom/TransportRequestId
- rename tests: prefix TestTrSolman allows to easily process
  subset.
2021-03-19 08:58:20 +01:00
Sven Merk
d52a1a3619
Influx step execution reporting (#2700)
* Influx step execution reporting

* influx for newmanExecute added

Co-authored-by: lndrschlz <leander.schulz01@sap.com>
2021-03-18 10:32:03 +01:00
lndrschlz
dea96a3ba0
feat(newmanExecute): golang implmementation for newmanExecute (#2513)
* Automates first parts of newmanExecute.groovy

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* Adds newman installation

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* Removes warning

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* makes tests robust for later shell calls

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* Adds version logging

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* Adds tests for version logging

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* Adds newman shell execution

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* Prepare cloud foundry apps with secrets handling

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* Adds further process to CF Utils

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* Fixes unit test

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* Adds error category

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* Add fix to execute step locally

Currently only tested on windows machine locally in powershell.

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* Adapt unit test to fix of runCommand

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* refactored golang step to newmanExecute

* wip

* added test config

* refactored newmanExecute groovy wrapper step

* exclude newmanExecute from common step test

* cleaups

* add credential support

* fix groovy credential providing

* add import

* add stageName

* define script

* remove unused vars

* add import

* fix iterator ref

* golang secret handling and cleanups

* wip

* wip

* wip

* update go step

* implement cf credential proposal

* testRepository functionality implemented

* register secrets to logger

* add missing dependecies

* test xsuaa credential handling

* wip

* wip

* cleanups

* add import

* remove mandatory params

* add container definition

* test runCommand

* test runCommand

* fix npm path

* fix npm path

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* added newmanEnvironment to templating

* wip

* use env and globals params in runCommand when no templating

* fix condition

* wip

* reverted config edit

* updated documentation

* install with shell

* wip

* wip

* fix tests

* refactor tests

* wip

* remove old test

* wip

* escape go tmpl

* escape go tmpl

* fix defaults

* add doc comment

* remove test case

* refactored newman commands

* add cli reporter

* refactor options

* mock os getenv and fix all tests

* refactoring and doc update

* go generate

* small refactor

* spelling

* fix newman doc

* remove MaskPasswords wrapper; fix stash bug;

* docu fix

Co-authored-by: Fabian Reh <fabian.reh@sap.com>
2021-03-17 08:08:33 +01:00
tiloKo
b04e3140de
SAP BTP ABAP Environment: addon build with supported Languages (#2689)
* first try

* fix unit test

* remove obsolete attributes
2021-03-15 20:24:43 +01:00
Daniel Mieg
0adca357da
remove warnings (#2698)
* remove warnings

* fix markdown
2021-03-15 10:49:42 +01:00
Christopher Fenner
0fcbfa8da7
feat(sonar): create report for issue count (#2691)
* create json report

* archive report

* add test case

* generate report

* correct report name
2021-03-12 15:05:07 +01:00
Christopher Fenner
4cabbca26e
docs(protecode): add description how to use fetch url for docker image (#2665)
* Update protecode.yaml

* update generated files

* update files

* fix typo
2021-03-12 09:58:21 +01:00
Mayur Belur Mohan
1b27805f64
IntegrationArtifact Cmd Fixes (#2628)
* IntegrationArtifact Cmd Fixes

* CodeClimate Fixes

* CodeClimate Fix

* integrationArtifactDownload Command Fix

* CodeClimate Fixes

* CodeReview Fixes

* CodeReview Fixes

* CodeReview Fixes

* CodeReview Fixes

* CodeReview Fixes

* CodeReview Fixes

* CodeReview FIxes

* CodeReview Fixes

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>
2021-03-11 12:03:32 +01:00
tiloKo
b81b11ca9d
abapEnvironmentAssemblePackages new Features (#2661)
* Unit Test Assemble Package

* Remove obsolete lines

dust wiping

* climate change

* climate change #2

* climate change #3

* climate change #4

* climate change #5

* NSPC serial builds

* Actual Delivery Commit

* Download Delivery_logs.zip

* Publish Result

* Testing

* !Polling

* Provide Commit to BF only if set

* dust wiping

* More Dust to Wipe

* Publish more than on file

* Write Log for Publish

* fix unit test (now Dummy Entries)

* save one line of code for climate change

* Update cmd/abapEnvironmentAssemblePackages.go

Co-authored-by: Daniel Mieg <56156797+DanielMieg@users.noreply.github.com>

* More Detailed Log Messages

Co-authored-by: Daniel Mieg <56156797+DanielMieg@users.noreply.github.com>
2021-03-11 11:55:12 +01:00
Christopher Fenner
f999925788
fix(influx): correct data type of influx measurements (#2171)
* update data type of influx measurements

* Update checkmarx.yaml

* pick changes from #1885 for testing

* update generated code

* update to new datatype

* adjust to type changes

* change back to string type

* Update fortifyExecuteScan.go

* add typo to be backward compatible

* change type to int for files_scanned and lines_of_code_scanned

* add typo

* add measurements to whitesource

* update generated sources

* adjust test cases

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-03-10 16:00:53 +01:00
Louis Lecaroz
67ef1f21c7
nexusUpload parameters reading from commonPipelineEnvironment (#2658)
* nexusUpload parameters reading from commonPipelineEnvironment

* Cleaning code formatting

* Fixing go fmt issues

* Fixing go generate files

* Fixing codeclimate issue

* Fixing with PR feedback

* Fixing unit test failure due to changed error message

* Fixing codeclimate on punctuatin in error message

* Fixing typo error in error message

Co-authored-by: LECAROZ <louis.lecaroz@sap.com>
2021-03-10 15:06:42 +01:00
Kevin Stiehl
f2b0683880
add token revocation (#2686)
* add token revocation

* update mocks

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-03-10 08:36:50 +01:00
Sven Merk
e1ea56076f
Http improve retry on timeouts (#2681)
* Add sca cmd extensibility

* Fix formatting

* HTTP retry

* Improve handling of retry on timeout

* Go fmt

* Fix test

* Fix test

* Test stability

* Fix test

* Fix test

* Fix test

* Update fortifyExecuteScan.go
2021-03-09 13:41:07 +01:00
Sven Merk
afdc726a01
Fortify cmd parameters for scan (#2680)
* Add sca cmd extensibility

* Fix formatting
2021-03-09 13:16:21 +01:00
Oliver Nocon
c077cdd733
fix(whitesourceExecuteScan) get full list of projects (#2672)
* fix(whitesourceExecuteScan) get full list of projects

* update doc
2021-03-08 17:01:18 +01:00
Siarhei Pazdniakou
cc66b7cabd
Added createBOM parameter to the npmExecuteScripts step (#2642)
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-03-04 10:16:59 +01:00
Sven Merk
84df77732c
fortifyExecuteScan: Pull request version not considered on upload (#2668) 2021-03-04 09:34:05 +01:00
Roland Stengel
cd8515acce
Go Unit Tests fail due to windows/linux file separator mismatch (#2662)
* Go Unit Tests fail due to windows/linux
file separator mismatch. See issue 2660.

* review results

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2021-03-03 22:58:29 +01:00
tiloKo
218a743fb1
abapEnvironmentAssemblePackages Unit Tests & Error Handling (#2654)
* Unit Test Assemble Package

* Remove obsolete lines

dust wiping

* climate change

* climate change #2

* climate change #3

* climate change #4

* climate change #5

Co-authored-by: Daniel Mieg <56156797+DanielMieg@users.noreply.github.com>
2021-03-01 13:51:44 +01:00
lndrschlz
4ca9186f39
fix(uiveri5ExecuteTests): add 'tests' stash to step yaml (#2641)
* add tests stash to uiveri5 step

* add stash to uiveri5

* extend step generator with input resources

* add step generator test
2021-03-01 13:03:42 +01:00
Sven Merk
d2eb2877e0
fortifyExecuteScan: Functional enhancements (#2647)
* Improvements

* Formatting

* Fix test

* Update resources/metadata/fortify.yaml

Enhance description

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>

* Unify version handling with ws step

* Part 2

* go fmt

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-02-26 13:43:03 +01:00
Daniel Mieg
3f8a1f141b
Update abapEnvironmentCloneGitRepo.go (#2656) 2021-02-26 09:27:22 +01:00
Nikolai Demidenko
eb87a2c976
Add createBOM parameter to the mavenBuild step (#2639)
* Add createBOM parameter to the mavenBuild step

* update generated files

* Update resources/metadata/mavenBuild.yaml

* Update resources/metadata/mavenBuild.yaml

* update generated mavenBuild

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-02-25 15:01:19 +01:00
Christopher Fenner
abc711299d
fix(sonar): disable measurements if no credentials are provided (#2653)
* disable if no credentials are provided

* exit early
2021-02-25 12:06:12 +01:00
Christopher Fenner
3875de8134
fix(sonar): use token provided by sonar-scanner-jenkins plugin (#2649) 2021-02-24 20:14:41 +01:00
Christopher Fenner
30baa31b90
fix(sonar): prevents step from contacting sonar API for legacy systems (#2648) 2021-02-24 18:05:04 +01:00
Christopher Fenner
cb3fa7c293
feat(sonar): add output of measurements (#2218)
* add sonarqube measurements

* fetch measurements from API

* add api for fetching issue counts

* add debug outputs

* add further severities

* log number of issues

* report failure

* expose method to send request

* Fixed what was broken.

* add debug output

* wip

* correct opaque property

* push client handling to apiClient.go

* use correct API URL

* correct log outputs

* remove logging

* remove option validation

* extend search options

* restructure

* rename api client file

* simplify client usage

* simplify issue client

* write sonar values to influx

* extract issue service

* reorder imports

* add sonar integration test

* allow unknown fields

* add test case

* add test case

* remove

* fix

* Update http.go

* Apply suggestions from code review

* Update cmd/sonarExecuteScan.go

* rework test cases

* use explicit returns

* add task service

* add waitfortask

* fix typo

* remove fixme

* expose poll interval

* rename test cases

* add test cases

* use newAPIClient method

* use waitForTask

* rename services

* finalize code

* handle error

* move defer

* move types

* add test case

* use http.status...

* add test case

* expose api endpoint names

* extract api client

* adjust test cases

* Update integration-tests-pr.yaml

* Update integration-tests.yaml

* improve require message

* Update integration-tests-pr.yaml

* Update integration-tests-pr.yaml
2021-02-24 15:44:23 +01:00