Commit Graph
46 Commits
Author SHA1 Message Date
Stephan AßmusandDaniel Kurzynski a09482a14f Convert invalid config value types (#1408)
Co-authored-by: Daniel Kurzynski <daniel.kurzynski@sap.com>
2020-04-17 10:29:18 +02:00
Stephan Aßmus ded6152b56 nexusUpload: Remove config processing from Groovy layer (#1364) 2020-04-04 11:44:02 +02:00
Stephan Aßmus 7dbf3ba5bf Generate documentation for nexusUpload (#1356) 2020-04-01 23:48:51 +02:00
Stephan Aßmus da0f25fd7b Piper-Go: Allow aliases also for inputs of type "secret" (#1355)
* Fix typos

* Support aliases also for secrets

* Adapt & extend Unit Tests

* Output deprecation warning for param/secret aliases

... if the alias is marked as 'deprecated'.
2020-04-01 20:46:33 +02:00
Stephan Aßmus 96030304a1 Restore possibility to run piper without config file (#1345) 2020-03-31 16:06:27 +02:00
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
Stephan AßmusandDaniel Kurzynski 0c6dabbd1e Pass custom config and default configs also to getConfig (#1346)
Co-authored-by: Daniel Kurzynski <daniel.kurzynski@sap.com>
2020-03-31 13:10:02 +02:00
Stephan Aßmus 527baf28fd Future proof the http-timeout test for go 1.14 (#1321)
Fix flaky test expectations. The exact error message has changed in go 1.14.
2020-03-31 09:18:09 +02:00
Stephan Aßmus 03096b5d05 Pass custom default-config files and custom project config from Jenkins side to piper (#1333) 2020-03-30 14:31:24 +02:00
Stephan Aßmus 804bd8e3e0 http.go: Set fine-grained timeouts (#1257)
* Replace the default maximum request deadline with a default timeout on the transport level.
* Keep the possibility to set a maximum request deadline.
2020-03-23 15:02:22 +01:00
Stephan Aßmus 4f7955bede Fix CLI exec call building for keytool (#1307) 2020-03-23 13:29:42 +01:00
Stephan AßmusandFlorian Wilhelm 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
Stephan Aßmus e51cfe276c Fix copy-paste-bug for downloading settings (#1284)
* Fix copy-paste-bug for downloading settings
* Extend unit tests accordingly.
* Fix some expected versus actual mixup
2020-03-17 08:33:35 +01:00
Stephan Aßmus e0c789a791 Add Evaluate() method to maven package (#1268)
Useful for evaluating properties from pom files using the Maven evaluate plugin.
2020-03-13 14:54:49 +01:00
Stephan Aßmus 84f3e10e3b Implementation of Nexus upload as Go package (#1250)
The nexus package implements uploading artifacts to a Nexus repository manager version 2 or 3 via HTTP. It also generates the MD5 and SHA1 hash files for the uploaded artifacts in the Nexus repository.
2020-03-06 23:10:10 +01:00
Stephan Aßmus 2014a8b4ae Utils.evaluateFromMavenPom(): Handle errors (#1192)
Handle error to evaluate by throwing an exception
2020-02-25 21:02:04 +01:00
Stephan Aßmus 9658f3b480 writeFile() cannot be passed a Map (#1163)
* writeFile() cannot be passed a Map

I've changed the return type of DebugReport.generateReport() from
String to Map in order to get the generated file name as part of the
return value instead of getting it from a field of DebugReport. The
UnitTest checks whether writeFile() creates the debug_report file
successfully and whether it has the expected contents. The effect
of passing the Map instead of map.contents to writeFile() should
have been an unnecessary wrapping via Map.toString() as in the test,
but in the execution context of Jenkins, this throws an
IllegalArgumentException: Could not instantiate {... and then the
results of map.toString().

* Improve JenkinsWriteFileRule compatibility

Calling m.text.toString() is wrong, since the type stored at m.text
already needs to be a String (or GString). Expecting valid parameters
here makes sure problems are detected by tests already. (All tests
pass as before.)
2020-02-10 12:25:33 +01:00
Stephan Aßmus 71766be2f5 Pass stageName to dockerExecuteOnKubernetes (#1162)
This fixes configuring sidecars for the given stage when Jenkins runs
on Kubernetes and the surounding stage has passed a stageName via parameters which is different from env.STAGE_NAME.
2020-02-08 12:57:55 +01:00
Stephan Aßmus c628d208c7 Implement archiving the debug report as step (#1152)
* Implement archiving the debug report as step
2020-02-07 16:30:08 +01:00
Stephan Aßmus ad7256a56e Merge pull request #1146 from SAP/extension-error-handling
Executing extensions in handlePipelineStepErrors
2020-02-04 14:28:09 +01:00
Stephan Aßmus 164c12b9f0 Executing extensions in handlePipelineStepErrors
The code of extensions was not executed within the try-catch-block of
handlePipelineStepErrors. The main benefit of this change is better
logging and re-using the 'unstable' feature also for
extended/overwritten steps.
2020-02-04 12:33:13 +01:00
Stephan Aßmus d1b94a8f29 Merge pull request #1143 from SAP/env-utils
Added EnvironmentUtils needed by DebugReport (#1126)
2020-02-04 06:35:43 +01:00
Stephan Aßmus 1d9ecdb999 Added EnvironmentUtils needed by DebugReport
This should have been added along with DebugReport. For context:
EnvironmentUtils used to be a class alongside DebugReport and thus
there was no 'import' directive. Working with Jenkins DSL stuff
has numbed my ability to pay attention to the IDE indicating errors.
2020-02-03 17:07:56 +01:00
Stephan Aßmus f6da8c6f3c Merge pull request #1126 from SAP/debug-report
Add DebugReport facility
2020-02-03 14:05:53 +01:00
Stephan Aßmus c06d4c95d6 Add pipelineStageWrapper test for global extension 2020-02-03 12:37:20 +01:00
Stephan Aßmus 0c2fb3181a Test DebugReport usage in piperStageWrapper 2020-02-03 12:37:20 +01:00
Stephan Aßmus 3010cb0c10 Test DebugReport usage in handlePipelineStepErrors 2020-02-03 12:37:20 +01:00
Stephan Aßmus fbcae5be53 Exchange wrong TODO with NOTE about what actually happens 2020-02-03 12:37:20 +01:00
Stephan Aßmus 942e6dd18a Don't check for isResilient, use failOnError 2020-02-03 12:37:20 +01:00
Stephan Aßmus 4420c34e4f Integrate DebugReport with handlePipelineStepErrors 2020-02-03 12:37:20 +01:00
Stephan Aßmus 8e953715a0 DebugReport: Log failure to retrieve Jenkins plugins 2020-02-03 12:37:20 +01:00
Stephan Aßmus 6c9e23db40 Feed DebugReport from piperStageWrapper
Information about overwritten/extended stages is stored in DebugReport (as done before in SDK Pipeline's runAsStage).
2020-02-03 12:37:20 +01:00
Stephan Aßmus 6e551dfc79 Add DebugReport facility
The DebugReport is a global instance where steps can store information relevant for diagnosing failed pipelines. In the SDK Pipeline, this is used to generate a debug report within the postActionArchiveDebugLog step. The reason for adding this to Piper is to feed information about extended or overwritten stages in piperStageWrapper into the DebugReport, as was done before in the SDK Pipeline's equivalent runAsStage step.
2020-02-03 12:37:20 +01:00
Stephan Aßmus 1f2ae0fcef Merge pull request #1122 from SAP/stashing-steps
Move stage stashing functionality into Utils
2020-01-29 21:57:09 +01:00
Stephan Aßmus c20dba2744 Merge branch 'master' into stashing-steps 2020-01-29 20:57:28 +01:00
Stephan Aßmus a7543fd19b Merge branch 'master' into stashing-steps 2020-01-29 16:19:17 +01:00
Stephan Aßmus 479123a800 Remove try-blocks in new stashing methods 2020-01-29 15:13:21 +01:00
Stephan Aßmus 948d07ce7d Merge branch 'master' into stashing-steps 2020-01-29 14:38:53 +01:00
Stephan Aßmus 282934d70a Merge branch 'master' into stashing-steps 2020-01-29 13:51:48 +01:00
Stephan Aßmus 40121f3fa0 Merge branch 'master' into stashing-steps 2020-01-29 13:36:29 +01:00
Stephan Aßmus 53833eaae9 Move stage stashing functionality into Utils
* No functional change intended
 * Steps in the SDK pipeline may use Utils for stashing,
   as separate stashFiles and unstashFiles steps are eliminated.
2020-01-29 12:30:07 +01:00
Stephan Aßmus 7ead134d68 Introduce support for different"interceptor APIs" in extensions 2020-01-24 14:06:09 +01:00
Stephan Aßmus 878e09abbb Adopt work-around for Jenkins on Kubernetes regarding deleteDir()...
... from SDK pipeline.
2020-01-24 11:29:35 +01:00
Stephan Aßmus ddd10683c4 Added support for old "interceptor API" for extensions
This is part of the effort to get rid of the "runAsStage" step in the SDK pipeline, and use piperStageWrapper directly. The SDK pipeline currently needs to support for loading "old" extensions where the call() method had different parameters. The support for the exact API can and should be removed, however, having a mechanism for supporting old extension APIs seems beneficial in general.

Another crucial change is the deleteDir() call before unstashing at the beginning of the stage. Without this, the SDK pipeline fails to unstash, since apparently the workspace may not always be clean at that point.
2020-01-24 11:29:35 +01:00
Stephan Aßmus f59d9f9d49 Added Unit-Test for extensions using an older API 2020-01-24 11:29:35 +01:00
Stephan Aßmus 88a2600d2d Removed ',' pointed out as syntax error by IDE 2020-01-24 11:29:34 +01:00