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

978 Commits

Author SHA1 Message Date
Kevin Hudemann
806f7c8a09
Add groovy wrapper for TemporaryCredentialsUtils (#1906)
This change adds the groovy step writeTemporaryCredentials, in order to
avoid resolving configuration parameters within the piperPipelineStageIntegration
in the future.
For the integration tests functionality provided by the SAP Cloud SDK
Pipeline it needs be possible to configure a credential id pointing to
Jenkins credentials, which are then temporarily written to a file to be
available during the execution of the integration tests.
With the previous implementation solely in the TemporaryCredentialsUtils
class, it would be required to resolve the credentialId from the
configuratuion within the piperPipelineStageIntegration, once we fully
migrate the Cloud SDK integration tests stage.
2020-08-10 17:54:03 +02:00
Kevin Hudemann
415efb066a
Add TemporaryCredentialsUtils (#1894)
This change adds a utils class to write credentials specified in Jenkins to a
temporary file, to be used for the execution of, e.g., integration tests
as already available in Cloud SDK Pipeline.
2020-08-07 16:12:34 +02:00
MuellerHenrik
3ab8b52c80
Add documentation + groovy file for the abapEnvironmentCheckoutBranch step (#1887)
* Add abaputils pkg and go files

* Add ReadServiceKeyAbapEnvironment function

* Fixes

* Add structs for SC, Pull and Branch

* Minor Improvements

* Adapt unit tests to new abaputils pkg

* Fixes

* Add adapted tests

* Fixes

* Fix cloudfoundry test

* Add check for host prefix (HTTPS)

* Fix tests + cleanup

* Fixes

* Fixes

* Fix

* Add mock for abaputils pkg unit tests

* Adapt abaputils comments

* Add abapEnvironmentCheckoutBranch step setup

* Change description of abapEnvCheckoutBranch step

* Add http client code

* Disable code due to missing interace

* Add coding for use of abaputils

* Adapt checkout branch step

* Adapt URL for checkout_branch function import

* Fixes

* Add unit test for missing params case

* Fix for missing mapping of CfSpace

* Fix for missing mapping of CfSpace

* Add working code for a Branch Checkout

* Fix host schema

* Remove LogoutOption param of unit tests and steps

* Fix unit test

* Fix unit test CF ReadServiceKey

* Add abapEnvironmentCheckoutBranch step setup

* Change description of abapEnvCheckoutBranch step

* Add http client code

* Disable code due to missing interace

* Add coding for use of abaputils

* Adapt checkout branch step

* Adapt URL for checkout_branch function import

* Fixes

* Fix for missing mapping of CfSpace

* Add working code for a Branch Checkout

* Adapt changes of abautils pkg

* Add test for polling

* Minor fix

* Fix yaml spacing

* Add longdescription to yaml

* Refactor abaputil methods

* Refactoring

* Refactoring

* Minor fix

* Minor fixeds

* Adapt to new abaputils.AUtilsMock

* Delete obsolete initial checks for params

* Fix manageGitRepoUtils_test.go

* Adjust pollEntity tests

* Add abapEnvironmentCheckoutBranch.groovy file

* Add documentation for abapEnvCheckoutBranch step

* Add step to whitelist in commonStepsTest.groovy

* Add GENERAL scope to host parameter

* Fix generated.go file

Co-authored-by: Daniel Mieg <56156797+DanielMieg@users.noreply.github.com>
2020-08-06 09:59:55 +02:00
Stephan Aßmus
aa9c88cef9
Do not collect test results in wrapper (#1869)
This is supposed to happen at the end of a stage
2020-07-30 16:10:20 +02:00
Stephan Aßmus
a61798ccbf
New step mavenExecuteIntegration (#1829)
Co-authored-by: Florian Wilhelm <florian.wilhelm02@sap.com>
2020-07-29 19:51:27 +02:00
Chris Bo
25decaa256
Introducing new step 'gctsRollback' (#1526)
* added new step gctsDeployCommit

* suggested PR fixes applied

* fixed test

* Remove unused imports

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

* added URL encoding for 'request' parameter

* regenerate after change

* add new step gctsRollbackCommit

* fixed typo in docu

* enhanced error messages

* minor changes

* renamed step to 'gctsDeploy'

* changed name

* remove space

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

* changed step name to gctsRollback

* changed function name

* fix conflict

* fixed gctsDeploy step name

* fix typo

* fixed error handling

* added Jenkins credentials for github token

* regenerated

* newly generated

* removed calling piper binary with go function call

* removed unused execRunner parameter

* cleaned up

* fixed merge conflict

* added docu page

* cleaned up

* provide Jenkins creds also in config.yaml

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-07-23 20:20:07 +02:00
Kevin Hudemann
eea0c1f35e
Use npmExecuteEndToEndTests step in Release/Acceptance stage if it is configured (#1813)
This change enables the use of the new npmExecuteEndToEndTests in the
stages release and acceptance if it is configured. If it is not
configured, nothing should change.
2020-07-17 13:59:14 +02:00
Kevin Hudemann
58e7e4be44
Add buildDescriptorExcludeList parameter to npmExecuteScripts step (#1800)
This change adds a buildDescriptorExcludeList parameter to
npmExecuteScripts, to enable the exclusion of certain directories when
executing npm scripts. Previously, npmExecuteScripts could only execute
scripts in all packages.

Now it is possible to provide paths or patterns as elements of the
buildDescriptorExcludeList to exclude packages when executing npm scripts.
2020-07-16 17:16:55 +02:00
Daniel Mieg
5dbb7be6b6
Fix commonPipelineEnvironment issue (#1798)
* Fix write to disk

* Change condition

* Test log output

* Fix

* Remove test log
2020-07-15 15:45:36 +02:00
Daniel Mieg
7f69f4eb16
Support lists in commonPipelineEnvironment (#1797)
* Enable write Lists

* Enable read

* Add tests

* Fix unit test

* CodeClimate Refactor

* Add comment
2020-07-15 10:09:42 +02:00
Daniel Kurzynski
82d8db2423
Reuse mtar file from mtaBuild in tmsUpload and cloudFoundryDeploy (#1794) 2020-07-15 08:32:05 +02:00
Kevin Hudemann
ebfb208528
Add report handling to npmExecuteEndToEndTests (#1791)
This change adds the missing report handling to npmExecuteEndToEndTests
step. In addition, it extends the testsPublishResults step to support
cucumber test results.
2020-07-14 13:33:49 +02:00
Chris Bo
9558b47268
Introducing new step 'gctsExecuteABAPUnitTests' (#1532)
* add new step 'gctsExecuteABAPUnitTests'

* added new step entries

* small wording improvement

* regenerated

* fixed unit tests

* adjusted prerequisites

* removed telemetry

* remove command

* moved functions to http package

* newly generated

* remove commented code

* use credentials ID in config.yaml

* add supported protocols to docu

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-07-14 10:58:57 +02:00
Kevin Hudemann
fd98d6279f
Add step for end to end test execution (#1786)
This change adds the end to end test execution capabilities of the SAP
Cloud SDK pipeline, i.e., the consumer can define a npm script which is
then executed using the npmExecuteScripts step.

The handling of generated results will be provided in a follow up PR.

Co-authored-by: Daniel Kurzynski <daniel.kurzynski@sap.com>
2020-07-13 15:10:12 +02:00
Florian Wilhelm
ccc77bbc11
Use multicloudDeploy step in Release/Acceptance Stage if it is configured (#1789)
The multicloudDeploy step is newer and more capable compared to the old steps. For pipelines that don't configure the multicloudDeploy step, nothing should change.
2020-07-13 14:26:26 +02:00
Oliver Nocon
111e4de8c3
kanikoExecute - golang version (#1765)
* kanikoExecute golang version

* update entrypoint

* update entrypoint

* update entrypoint

* update entrypoint

* update entrypoint

* add command

* include PR feedback

* remove trailing spaces

* remove defaults for certificates

* Update generated file
2020-07-10 08:07:59 +02:00
Daniel Kurzynski
5749b47c75
Fix containers map and add test (#1769) 2020-07-07 12:07:44 +02:00
Kevin Hudemann
c8ca3ea522
Add mta extension credentials handling to cloudFoundryDeploy step and infer deployTool default from buildTool (#1761) 2020-07-06 16:16:48 +02:00
Oliver Nocon
520f2cc975
Fix stashing of piper binary (#1764)
* Update piperExecuteBin.groovy

* update tests
2020-07-06 13:22:36 +02:00
Alejandra Ferreiro Vidal
12e1ff0c60
Add mta extension descriptor (#1729)
Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>
Co-authored-by: Daniel Kurzynski <daniel.kurzynski@sap.com>
2020-07-06 12:16:06 +02:00
Florian Wilhelm
209d940522
Cf validate app name (#1759)
CF deployment will fail if you have an _ in the app name. Also in general names should only contain alphanumeric chars. Warn users if it does not.
2020-07-06 11:45:36 +02:00
Daniel Kurzynski
e6ab6f815f
Default source for maven deployments to neo (#1755) 2020-07-03 09:56:14 +02:00
Oliver Nocon
49b7abb4ca
Fix stashing issue with binrary execution (#1749)
Co-authored-by: Daniel Kurzynski <daniel.kurzynski@sap.com>
2020-07-02 12:08:56 +02:00
Florian Wilhelm
b5dbd0dafc
Cf create services in multiclouddeploy step (#1736) 2020-07-01 17:28:50 +02:00
Kevin Hudemann
12455ae747
Separate log folders for neo deployments (#1747)
Previously, all logs were stored in the same folder and in case of an
error all logs in that folder would be returned to the user. Thus, it
is possible that unrelated logs, i.e., from different deployments (in
case of parallel deployments) are returned to the user.
2020-07-01 16:36:08 +02:00
Kevin Hudemann
89e8209f8e
Add isolation for CF Deployments in multicloudDeploy step (#1742)
This change adds isolation to CF deployments, when using blue-green
deployments in multicloudDeploy step.
2020-07-01 16:08:12 +02:00
Alejandra Ferreiro Vidal
3d9606022f
add parallel execution to multicloudDeploy (#670)
* add parallelExecution to multicloudDeploy

adds parallel execution to the step multicloudDeploy

* add log

* fix warning

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>
2020-06-24 10:56:36 +02:00
Daniel Mieg
f348c53989
Add ABAP Environment Pipeline (#1555) 2020-06-23 15:56:56 +02:00
Daniel Kurzynski
654dea4b3e
Load global extensions in setupCommonPipelineEnvironment (#1688)
Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
Co-authored-by: Florian Wilhelm <florian.wilhelm02@sap.com>
2020-06-22 17:52:11 +02:00
lydiazcheng
59f3cddd43
TMS: extend upload mta ext descriptor to node (#1635)
* add APIs for getNodes, getExtDescriptor, putExtDescriptor and uploadExtDescriptor
* add new params and extend the logic to enable upload or update extension descriptor to node
* extends unit tests


Co-authored-by: Zihe Cheng <zihe.cheng@sap.com>
Co-authored-by: Marcus Holl <marcus.holl@sap.com>
2020-06-22 11:34:10 +02:00
Kevin Hudemann
60fa1d5bbf
Add Java-/Typescript linting capabilities (#1636)
This change adds linting support for Java-/TypeScript projects based on the checkDefaultLint and checkUserLint steps from Cloud SDK Pipeline.

Following options are supported:

1. Define a linting script named ci-lint in the package.json file(s) of the project
2. Provide a configuration for ESLint as part of the project
3. If none of the above: ESLint is executed with a general purpose configuration.

Co-authored-by: Daniel Kurzynski <daniel.kurzynski@sap.com>
2020-06-22 10:12:28 +02:00
Oliver Nocon
d602c6e2b9
extend security stage (#1687)
* extend security stage

Add new steps
* checkmarxExecuteScan
* fortifyExecuteScan

closes #1650

* update tests
2020-06-19 12:35:02 +02:00
Chris Bo
e9ad8c5e9c
Introducing new step 'gctsCloneRepository' (#1468)
* added new step gctsCloneRepository

* enhanced docu

* adjusted test case name

* enhanced docu

* refined error messages

* regenerated & remove unused Groovy imports

* small change

* remove execRunner

* Update documentation/docs/steps/gctsCloneRepository.md

* regenerated

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-06-18 07:45:22 +02:00
Daniel Kurzynski
498e527c6c
Add npmExecuteScripts to integration stage (#1674)
Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-06-17 18:17:05 +02:00
Oliver Nocon
8e74952166
Switch Detect scan to golang implementation (#1673)
* Switch Detect scan to golang implementation

* update workingDir

* use universal container as default

* Switch to official curl image

* fix code climate issue

* switch default image

* update docker options

* update CommonStepsTest

* remove invalid groovy test

* clean up defaults

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-06-16 17:21:59 +02:00
Alexander Link
a864cf0f60
Fix docker.includes in WhitesourceConfigurationHelper (#1666)
* Fix docker.includes in WhitesourceConfigurationHelper

Not sure, but it seems the [`docker.includes` parameter](https://whitesource.atlassian.net/wiki/spaces/WD/pages/804814917/Unified+Agent+Configuration+File+and+Parameters#UnifiedAgentConfigurationFileandParameters-DockerImages) needs to be a regex.

Our pipeline is failing with:
```
10:22:33  [ERROR] [2020-06-15 08:22:33,740 +0000] - Resolve DockerEntity Exception Dangling meta character '*' near index 0
10:22:33  *.tar
10:22:33  ^
10:22:33  [DEBUG] [2020-06-15 08:22:33,743 +0000] - Resolve DockerEntity Exception {}
10:22:33  java.util.regex.PatternSyntaxException: Dangling meta character '*' near index 0
10:22:33  *.tar
10:22:33  ^
10:22:33  	at java.base/java.util.regex.Pattern.error(Unknown Source)
10:22:33  	at java.base/java.util.regex.Pattern.sequence(Unknown Source)
10:22:33  	at java.base/java.util.regex.Pattern.expr(Unknown Source)
10:22:33  	at java.base/java.util.regex.Pattern.compile(Unknown Source)
10:22:33  	at java.base/java.util.regex.Pattern.<init>(Unknown Source)
10:22:33  	at java.base/java.util.regex.Pattern.compile(Unknown Source)
10:22:33  	at org.whitesource.utils.WssStringUtils.isMatchingPattern(WssStringUtils.java:49)
10:22:33  	at org.whitesource.agent.dependency.resolver.docker.DockerResolver.filterTarImagesToScan(DockerResolver.java:296)
10:22:33  	at org.whitesource.agent.dependency.resolver.docker.DockerResolver.resolveDockerEntities(DockerResolver.java:186)
10:22:33  	at org.whitesource.fs.scanOrigins.DockerEntityScanOrigin.scan(DockerEntityScanOrigin.java:66)
10:22:33  	at org.whitesource.fs.scanOrigins.ScanOrigin.runOriginScan(ScanOrigin.java:36)
10:22:33  	at org.whitesource.fs.FileSystemAgent.createProjects(FileSystemAgent.java:132)
10:22:33  	at org.whitesource.fs.Main.scanAndSend(Main.java:157)
10:22:33  	at org.whitesource.fs.Main.main(Main.java:102)
10:22:33  [WARN] [2020-06-15 08:22:33,744 +0000] - Resolve DockerEntity Exception Dangling meta character '*' near index 0
10:22:33  *.tar
10:22:33  ^
```

* Switch docker.includes to slashy string

* Fix docker includes pattern in tests

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
Co-authored-by: D070410 <srinikitha.kondreddy@sap.com>
2020-06-15 17:02:28 +02:00
Oliver Nocon
f125ba5b60
adding groovy wrapper for containerSaveImage (#1663) 2020-06-15 16:44:49 +02:00
sudeepsukumar
702664645c
feat(newman): fetch xsuaa credentials in newman execution (#1325)
* fetch xsuaa credentials in newman execution

* refactor CfUtils and moving to integration package

* removing CfUtils from old package com.sap.piper

* avoid config.verbose as "null"

* variable renamed for consistent naming

* handling NPE and other comments incorp

* added test cases

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-06-12 10:04:03 +02:00
Daniel Kurzynski
d1cdf4449c
Fix reading download cache variables on node (#1660) 2020-06-11 21:59:55 +02:00
Daniel Kurzynski
d9a8537eb5
Revert to again use curl to download binary (#1637)
Revert "Remove curl for unstashing binary (#1580)"
This reverts commit 8b296f74

Improve error message

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-06-10 10:11:20 +02:00
Florian Wilhelm
c490ce9211
Use go-based npmExecuteScripts, mavenBuild in buildExecute (#1622) 2020-06-04 17:53:06 +02:00
Marcus Holl
f071b4490d
Fix: yaml util handling for boolean with value false (#1629)
* Provide test for yamlUtils substitution with boolean value false

* Fix: handle booleans with value 'false' in yaml substitution

* Improve variable naming
2020-06-04 06:03:12 +02:00
Maximilian Lenkeit
10e5bf98f8
artifactPrepareVersion: remember original artifact version (#1600)
* Update resources.go

* expose originalArtifactVersion parameter

* re-generate steps

* adjust golden files for generator changes
2020-05-28 10:05:22 +02:00
Daniel Kurzynski
3992f17b32
Fix injection of download cache parameters (#1605)
- NPMRegistry was always an empty string
- MTA did not use npm registry
2020-05-27 18:20:10 +02:00
Oliver Nocon
5e27d26a7c
whitesourceExecuteScan: add Docker image scanning (#1556)
* whitesourceExecuteScan: add Docker image scanning

* add test

* Update whitesourceExecuteScan.groovy

* Update WhitesourceConfigurationHelper.groovy
2020-05-27 16:27:36 +02:00
Daniel Kurzynski
8b296f7420
Remove curl for unstashing binary (#1580) 2020-05-27 13:30:04 +02:00
Marcus Holl
1836bb728b
Emit piper version to log (#1583)
* introduce variable for piper bin

* log the version of the piper bin

* don't fail with generic message from script execution (sh)
2020-05-26 09:38:47 +02:00
Oliver Nocon
d5d510719d
piperExecuteBin - prevent non-speaking exit code 1 error (#1584)
* piperExecuteBin - prevent non-speaking exit code 1 error

Make sure that error during context resolution gets more context.

* properly provide golang errors

* improve error message, when no details are available

* Add error category

* Update getConfig.go
2020-05-26 07:58:03 +02:00
lndrschlz
80f70aba4a
Error reporting: change category to standard term (#1587)
* streamlined error category with standard term

* remove unused import from test

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-05-25 22:38:26 +02:00
Sven Merk
af2a01c064
Fortify implementation in golang (#1428) 2020-05-25 19:48:59 +02:00