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

2503 Commits

Author SHA1 Message Date
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
Florian Wilhelm
941eba0472
Fix Could not find matching constructor for: hudson.FilePath (#1134)
The constructor for hudson.FilePath does not take a file, but rather a
string containing the path to the file.
2020-02-03 12:28:16 +01:00
Christopher Fenner
768c6aa399
fix: generator for custom steps (#1139) 2020-01-31 15:39:45 +01:00
Christopher Fenner
d2b8b373b9
chore(pipeline): add GO unit test as GH action (#1138)
* add GO unit test job

* Update .github/workflows/verify-go.yml
2020-01-31 15:18:34 +01:00
Oliver Nocon
b542d15998
Enhance telemetry reporting (#1133)
* Enhance telemetry reporting
* Use central telemetry data object
* Add duration

Co-Authored-By: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-01-31 14:06:08 +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
Christopher Fenner
2da06bfa91
chore(build): use GH actions to verify if go codebase is up to date (#1125)
* add action to keep codebase up to date

* add go mod tidy command

* use official go action

* correct go fmt command

* fix code climate findings

* remove dummy changes

* separate checks
2020-01-29 18:09:51 +01:00
Stephan Aßmus
a7543fd19b
Merge branch 'master' into stashing-steps 2020-01-29 16:19:17 +01:00
Oliver Nocon
152c4dc9d2
Pass container image via CPE (#1113)
* Pass container image via CPE
* Update generated step
* update map name to better represent content
2020-01-29 16:03:18 +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
Marcus Holl
40f0a17b45
re-use execRunner for envExecRunner (#1117)
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-01-29 14:22:43 +01:00
Marcus Holl
cea3d0b4e3
Add test handling exception in dockerExecuteOnK8S in case exception is raised. (#1081)
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-01-29 14:15:12 +01:00
Stephan Aßmus
282934d70a
Merge branch 'master' into stashing-steps 2020-01-29 13:51:48 +01:00
Sven Merk
4b1ca5697d
Add missing test (#1116)
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-01-29 13:46:28 +01:00
Stephan Aßmus
40121f3fa0
Merge branch 'master' into stashing-steps 2020-01-29 13:36:29 +01:00
Christopher Fenner
aa3fb8adb4
feat(go): add telemetry reporting (#1100)
* Add telemetry support

* First round telemetry

* Add telemetry flag

* fix: move files to avoid import cycles

* add noTelemetry as global config option

* Respect telemetry configuration for reporting

* add site id, swa endpoint

* correct logger initialization

* add http logic

* rename init method

* rename consts & types

* convert struct to payload

* convert data to payload string

* move activation flag out of data structure

* extract types to own file

* build query using net/url

* correct field mapping

* extract notify coding to own file

* cleanup parameter mapping

* preare base data

* fix codeclimate issue

* correct test case

* fill values from env

* test all fields

* untrack notify.go

* ignore empty custom values

* cleanup data.go

* add test cases

* cleanup

* add usage reporting to karma step

* add usage reporting to step generator

* externalise siteID

* correct custom field names

* test env handling

* simplify method signature

* revert parameter negation

* correct import

* adjust golden file

* inclease log level

* ignore test case

* Revert "inclease log level"

This reverts commit 70cae0e029.

* add test case for envvars

* remove duplicate reporting

* remove duplicate reporting

* correct format

* regenerate checkmarx file

* add log message on deactivation

* rename function

* add comments to understand SWA mapping

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-01-29 13:17:54 +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
Christopher Fenner
92441577d8
fix(NPM): change NodeJS image to LTS (#1069)
* change NodeJS image to current LTS

* Update default_pipeline_environment.yml

* Update SonarExecuteScanTest.groovy

* use node:lts-stretch image
2020-01-29 11:17:56 +01:00
Marcus Holl
7b95c04752
[refactor] CPE read/write from/to disk: remote repetitive coding (#1110)
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-01-28 13:22:37 +01:00
Sven Merk
cbe368fe36
Checkmarx as golang (#1075)
* Added base functionality for checkmarx interaction

* Extend http client with file upload capabilities

* Latest changes

* Add debug logging

* Introduce Uploader interface

* Add tests for checkmarx client

* Hook new checkmarx command

* Improve coverage

* Add tests

* Improved test coverage and fixed code

* Add influx reporting

* Add alternation capabilities

* Add groovy step

* Try fix cmd

* Enhancements

* Fix report generation

* Final performance improvements

* Fix code

* Structure code, cleanup

* Improvements

* Fix codeclimate issue

* Update groovy

* Adapt latest changes to http

* Fix test

* Fix http tests

* Fix test

* Fix test

* Fix test 2

* Fix code

* Fix code 2

* Fix code

* Code

* Fix

* Fix

* Add report and link handling

* Fix returns, add groovy test

* Review comments

* Added doc template

* Docs update

* Remove SAP internals

* Better status display

* Add name to link

* Fix test

* Fix

* Fix verbose handling

* Fix verbose handling 2

* Fix verbose handling 3

* Fix

* Tiny improvements

* Regenerate

* Fix test

* Fix test code

* Fix verbosity issue

* Fix test

* Fix test

* Fix test
2020-01-27 23:40:53 +01:00
Oliver Nocon
73ab887f25
Add kubernetesDeploy step (#1073)
* Add kubernetesDeploy step

Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2020-01-24 14:30:27 +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
Marcus Holl
c448a72930
Trim spaces from config value while reading CPE (#1103) 2020-01-23 12:02:34 +01:00
Florian Geckeler
b509e14afd
Use maven evaluate for mavenArtifactVersioning
* add evaluateFromMavenPom to piper Utils
* adapt mavenExecute to accept `returnStdout` as parameter. If configured mavenExecute will return the stdout for further processing
* adapt tests of mavenExecute and mavenArtifactVersioning as well as add another exception to CommonStepsTest because mavenExecute will return a String if configured
2020-01-23 09:31:01 +01:00
redehnroV
74deceed10
Merge pull request #1106 from SAP/SV/Http
improved Upload to handle http.Method
2020-01-22 15:51:16 +01:00
Sven Merk
71d0842c07
Update http_test.go 2020-01-22 15:26:35 +01:00
Sascha Vornheder
979ed1fabd added check that only POST and PUT is allowed for upload 2020-01-22 15:10:40 +01:00
Sascha Vornheder
1ae1be9cb9 improved Upload to handle http.Method 2020-01-22 14:22:04 +01:00
Daniel Mieg
48a76bc4d2 Fix random UUID generation in Unit Tests (#1099)
* Fix random UUID generation in Unit Tests

* Use before and after methods

* Add import of org.junit.After

* Add go step for abapEnvironmentPullGitRepo

* Revert "Add go step for abapEnvironmentPullGitRepo"

This reverts commit 08b6b16217.

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>
2020-01-22 10:50:26 +01:00
Christopher Fenner
ce47a80d19 chore(test): cleanup metaClass (#1104) 2020-01-22 08:57:37 +01:00
Marcus Holl
060d088e1d
Merge pull request #1101 from marcusholl/pr/mtaViaCPE
mta file via CPE and better support for configuration handling
2020-01-20 12:47:07 +01:00
Marcus Holl
820b878819 Align property naming 2020-01-17 09:45:47 +01:00
Marcus Holl
8563da8dda Use old approach for resolving mode action and docker related params
On groovy level we take into account:

- parameters via signature
- project config
- landscape config(s)
- for docker: nested and plain config

also more tests added ...
2020-01-17 09:40:31 +01:00
Marcus Holl
ecb5a9f42d take mta from cpe into account 2020-01-15 15:24:29 +01:00
Marcus Holl
2a52e5cf6d Ensure backward compatibility for docker parameters
In case docker parameters are configured in the project config or
in a landscape layer we have to take care. The corresponding values from
the context config are only the fallbacks.
2020-01-15 14:00:46 +01:00
Oliver Nocon
a46b57e6b4
Persisted pipeline environment for golang library (#1091)
* Use commonPipelineEnvironment in go binary

* Update groovy part incl. tests

* Rework structure and naming

* Support influx resources in steps

* Update tests and some cleanups

* Add correct defer handling

* Address PR feedback

* Fix test

* Update resources.go

Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2020-01-15 12:16:25 +01:00
Marcus Holl
e5db600cf4
Merge pull request #1017 from marcusholl/pr/xsDeployGroovyWithGi
xsDeploy.groovy forwarding to go
2020-01-15 08:54:24 +01:00
Florian Geckeler
a8e88565d7
Use maven eveluate for mavenArtifactVersioning
* add evaluateFromMavenPom to piper Utils
* adapt mavenExecute to accept returnStdout as parameter. If configured mavenExecute will return the stdout for further processing (here grep'ing output of mvn help:evaluate)
* adapted the tests of mavenExecute and mavenArtifactVersioning as well as adding another exception to CommonStepsTest because mavenExecute will return a String if configured
2020-01-14 19:17:47 +01:00
Marcus Holl
128697e69a Merge remote-tracking branch 'github/master' into HEAD 2020-01-14 10:45:10 +01:00
Sven Merk
997ae27ccd
Merge pull request #1096 from SAP/http_uploader
Add upload of files to HTTP capabilities
2020-01-14 10:44:30 +01:00
Sven Merk
acadf24d27 Add upload of files 2020-01-14 10:29:50 +01:00
Christopher Fenner
53317222a3
fix: correct step parameters (unknown parameters found) (#1093)
* fix: correct step invocations (WARNING: Unknown parameter(s) found for class)

* fix: correct step invocations (WARNING: Unknown parameter(s) found for class)
2020-01-13 16:28:12 +01:00