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

770 Commits

Author SHA1 Message Date
Alejandra Ferreiro Vidal
79b79457f4 remove !#groovy header 2019-05-23 10:37:28 +02:00
Marcus Holl
4b61f362d2 Removing syntactically not needed commas which helps keeping diff smaller 2019-05-23 09:23:36 +02:00
Marcus Holl
ed155ece63 rename mtaExtensionDescriptos to extensions 2019-05-23 09:20:10 +02:00
Oliver Nocon
dbf110504e
Templates - Add advanced confirm stage (#720)
* Templates - Confirm Stage
* include feedback: allow customizing of default message
* adapt docs
* add default message
2019-05-22 10:42:59 +02:00
Marcus Holl
f87349e0fe Condence dupliate code in test (file exists closure) 2019-05-22 08:49:27 +02:00
Marcus Holl
f6b165052a Remove not needed test setup wrt file exists check 2019-05-22 08:11:28 +02:00
Marcus Holl
9f7056b73f Reuse getSteps from StepHelper in common step tests 2019-05-17 12:11:29 +02:00
Marcus Holl
f83935d248 Merge remote-tracking branch 'github/master' into HEAD 2019-05-17 12:05:34 +02:00
Christopher Fenner
3a3b15e9ba
Merge branch 'master' into pr/inlineRules 2019-05-16 11:35:22 +02:00
Marcus Holl
1a907a834d Merge remote-tracking branch 'github/master' into HEAD 2019-05-16 09:13:51 +02:00
Marcus Holl
74af6bab5f Add extensions to neoDeploy
Extensions can be provided via --extension --e to the neo deploy command
line for deploy-mta. This commits adds support for providing extension files.
2019-05-16 09:13:23 +02:00
Christopher Fenner
9db487d189
move method to MapUtils (#709)
* move method to MapUtils

* use MapUtils

* fix indent

* Update src/com/sap/piper/MapUtils.groovy

* Update MapUtils.groovy

* remove obsolete test case

* fix typo
2019-05-15 20:52:45 +02:00
Marcus Holl
abdfa7b201 [refactoring] Increase readabiliy: inline rules without references 2019-05-15 17:03:41 +02:00
Marcus Holl
f38729c5eb Merge remote-tracking branch 'github/master' into HEAD 2019-05-15 14:23:38 +02:00
Marcus Holl
7a7fd3ebab Provide a deep config copy from ConfigHelper.use()
The config map prepared by ConfigHelper is a mix from several configuration levels. The lowest config level
(DefaultValueCache) is shared between several ConfigHelper invocations. In case a Map or Collection which is
inherited from the DefaultValueCache level gets modified, this is also visible for all subsequent steps. This
causes trouble and situation which are hard to debug.

With this change here each invocation of ConfigHelper.use() provides a deep defensive copy. With that we can
ensure that there is no configuration update from one step to another.
2019-05-14 12:43:18 +02:00
Christopher Fenner
c8f9db71eb
add step for Sonar scan (#183)
* add new step sonarExecute

* simplify list

* add general credentials for SonarQube

* Update default_pipeline_environment.yml

* Update sonarExecute.groovy

* correct worker invocation

* switch step/stage config order

* add tests

* add webhook handling

* Update default_pipeline_environment.yml

* use withMandatoryProperty with condition

* Update ConfigurationHelper.groovy

* Update sonarExecute.groovy

* Update ConfigurationHelper.groovy

* rename step to sonarExecuteScan

* rename step to sonarExecuteScan

* rename step to sonarExecuteScan

* Update sonarExecuteScan.groovy

* change return type

* Update sonarExecuteScan.groovy

* stash

* update defaults

* update install path

* use quiet unzip

* use long option names

* optimize filename retrival

* rework PR voting

* fix path

* remove accitentially checked-in file

* add documentation, optimise coding

* correct test case

* add documentation

* remove option prefix

* rename config variable

* update docs

* update docs

* rename download url

* fix typo

* adjust test cases

* add test cases

* update docs
2019-05-13 12:29:07 +02:00
Christopher Fenner
8a55e25f72
add Slack notification to Init and Post stage (#691)
* add Slack notification to post stage

* add Slack notification to init stage

* add trigger condition for Slack notification

* fix whitespaces

* use capital stage name

* add tests for init stage

* remove unused import

* add tests for post stage

* minor changes

* fix typo
2019-05-10 06:47:44 +02:00
Marcus Holl
fb22711c2a Merge remote-tracking branch 'github/master' into HEAD 2019-05-09 15:29:45 +02:00
Alejandra Ferreiro Vidal
7724469f58 add unit tests for withPropertyInValues 2019-05-09 13:35:36 +02:00
Alejandra Ferreiro Vidal
043c228115 fix wrong message 2019-05-09 13:35:36 +02:00
Florian Geckeler
79b55cc064
Enable configuration of npm registry for mtaBuild 2019-05-09 08:51:11 +02:00
Oliver Nocon
e20eb3c320
pipeline initialization - support nested keys (#695)
* pipeline initialization - support nested keys

support a nested structure for config keys for initialization conditions, like

```
Acceptance:
    stepConditions:
      cloudFoundryDeploy:
        configKeys:
          - 'cfSpace'
          - 'cloudFoundry/space'
```

* optimize code
2019-05-08 12:04:47 +02:00
Oliver Nocon
a67f850fdb
add step for Synopsis Detect Scans (#690)
* add step for Synopsis Detect Scans

tool was formerly calles Blackduck Hub Detect.
Details about the tool can be found here: https://synopsys.atlassian.net/wiki/spaces/INTDOCS/pages/62423113/Synopsys+Detect
2019-05-08 11:36:01 +02:00
Sven Merk
94e72898b1 whitesourceExecuteScan: Fix suffix collision for MTA scenario (#689)
* Apply fix for stash name collision
* Adapt tests
2019-05-03 17:33:52 +02:00
Oliver Nocon
14efc51d24
whitesourceExecuteScan - fix stashing behavior for golang (#688)
* whitesourceExecuteScan - fix stashing behavior for golang
**changes:**

golang scan requires sources to be present. They are already part of the `checkmarx` stash which can be used here.

* fix tests
2019-05-03 16:21:36 +02:00
Oliver Nocon
6c5d9f2f61
Pipelines - extend init conditions (#676)
extends init condition with condition `configKeys`
This condition allows to specify a list of configuration keys which if any key is set will activate the respective step & stage
2019-05-02 22:09:15 +02:00
Oliver Nocon
700a6e2e4e
Add step kanikoExecute for Docker builds using Kaniko (#684)
* Add step kanikoExecute for Docker builds using Kaniko
* Update kanikoExecute.md
* address PR feedback
2019-05-02 17:29:11 +02:00
Christopher Fenner
e8f206b1a1
piperPipeline: add extensible post stage (#661)
* add post stage

* use post stage in template

* adjust test cases

* add docs skeleton

* add documentation

* Update piperPipelineStagePost.md
2019-05-02 12:26:28 +02:00
Alejandra Ferreiro Vidal
15cfed66a4 remove parameters not related to warPropertiesFile 2019-04-30 13:36:07 +02:00
Florian Wilhelm
49c704c9aa
Allow setting global maven config in MTA builder (#667) 2019-04-24 12:47:37 +02:00
Florian Wilhelm
ee42e66802
Honor maven user-settings file for mta build (#663)
Allow setting custom settings file for maven in mta build, which is for example required if a custom maven repo (i.e. company internal) needs to be used.
2019-04-17 10:44:55 +02:00
Christopher Fenner
eacec4279d
piperPipeline: handle build result correctly (#660)
* add new step buildSetResult

* set pipeline result in post stage

* exclude buildSetResult from commonStepTests

* extend pipeline test

* remove post stage reference
2019-04-15 14:18:08 +02:00
Alejandra Ferreiro Vidal
5448385985 add multicloud deploy step 2019-04-12 17:51:38 +02:00
Marcus Holl
71c0df4d5f Merge remote-tracking branch 'github/master' into HEAD 2019-04-12 13:48:31 +02:00
Marcus Holl
fc93326805 Merge remote-tracking branch 'github/master' into HEAD 2019-04-12 13:13:31 +02:00
Marcus Holl
862729a703 Adjust test after merging early check for the deployable
In the meantime we check earlier if the deployable exists. Up to now the test used that late check. Now, as that
check happens earlier in the code we have to tune here. Now we assume a failure inside neo deploy instead.
2019-04-12 13:13:25 +02:00
Alejandra Ferreiro Vidal
f9db4245e9 cloudFoundryDeploy: generate docu 2019-04-12 13:08:05 +02:00
Marcus Holl
28fa30fc8f Do not swallow original excpetion when we have trouble to cat the logs 2019-04-12 10:06:18 +02:00
Christopher Fenner
e67b9cff23
influxWriteData: hold data in dedicated object (#624)
* add InfluxData object

* add InfluxData rule

* use InfluxData

* include jenkins_custom_data into InfluxData object

* correct typo

* add missing import

* fix condition for influx reporting

* add test class

* Update influxWriteData.groovy
2019-04-11 11:39:41 +02:00
Christopher Fenner
e90ffa6bf5
commonPipelineEnvironment: add propertiesMap (#526)
* add customPropertiesMap

* migrate transportRequestId to customPropertiesMap

* migrate transportRequestId to customPropertiesMap

* fix typo

* rename map

* rename method due to name clash
2019-04-10 10:56:36 +02:00
Alejandra Ferreiro Vidal
86978becfc remove utils.getMandatoryParameter() 2019-04-09 16:25:25 +02:00
Oliver Nocon
4d945c8557
handlePipelineStepErrors - allow step timeouts (#644)
* handlePipelineStepErrors - allow step timeouts

This adds another resilience option:
A timeout can be configured for steps in order to stop step execution, continue with the pipeline while setting build status to "UNSTABLE"
2019-04-05 11:16:34 +02:00
Sven Merk
bccec4259a Fix scala test 2019-04-04 21:20:25 +02:00
Sven Merk
259619f00f
Merge branch 'master' into whitesource-step 2019-04-04 16:06:51 +02:00
Oliver Nocon
138656b49b
Allow resilient error handling in pipelines (#583)
* add resilience to error handling
* adapt documentation
* make ConfigLoader more resilient
2019-04-04 08:38:54 +02:00
Sven Merk
1fe05b8a56
Merge branch 'master' into whitesource-step 2019-04-03 12:19:34 +02:00
Holger Partsch
b1d8032ee2 alpine does not support date option --universal (#578)
* alpine does not support date option --universal

Replaced by --utc as this seems to be more universal than --universal

* Fix unit tests after date parameter change
2019-04-02 15:59:33 +02:00
Holger Partsch
025ce5a88e Don't use host port (#579)
* Stop using host ports

* Sort parameters alphabetically

* Fix warning format
2019-04-02 14:23:19 +02:00
Oliver Nocon
24563db155
update stashing behavior (#628)
* update stashing behavior

close #619

* add test
2019-04-02 13:13:25 +02:00
Sven Merk
7f4f0eef00 JSON strings into tripple quotes 2019-04-01 16:33:10 +02:00
Sven Merk
b618764a00 Use ExpectedException 2019-04-01 16:13:48 +02:00
Sven Merk
a43760d34a Use JenkinsCredentialsRule 2019-04-01 15:59:20 +02:00
Sven Merk
4e144b80a1 Refactor test to address last review comments 2019-04-01 14:43:44 +02:00
Sven Merk
8d1ce13e4e Refactor test to address review comments 2019-04-01 09:03:56 +02:00
Sven Merk
1b7b1c5214 Refactor test to address review comments 2019-04-01 09:01:31 +02:00
Sven Merk
3191d8bb26 Fix mime type for accept header 2019-03-29 14:45:05 +01:00
Sven Merk
55e3622e6b Remove obsolete code, avoid caching of request 2019-03-29 14:38:43 +01:00
Sven Merk
d169bfb619 Refactor file download 2019-03-29 14:22:42 +01:00
Sven Merk
c82bcc9c86 Addressed feedback 2019-03-29 13:58:41 +01:00
Sven Merk
aaf969e0cf
Merge branch 'master' into whitesource-step 2019-03-29 11:01:15 +01:00
Sven Merk
069d2d69f9
Merge branch 'master' into whitesource-step 2019-03-29 09:01:09 +01:00
Alejandra Ferreiro Vidal
6b98d642da removes toolValidate 2019-03-29 08:44:36 +01:00
Sven Merk
452158256c
Merge branch 'master' into whitesource-step 2019-03-28 16:59:14 +01:00
Alejandra Ferreiro Vidal
8e59531789 format: add new lines following format 2019-03-28 14:10:32 +01:00
Alejandra Ferreiro Vidal
060c5066e8 remove deprecated code 2019-03-28 14:10:32 +01:00
Alejandra Ferreiro Vidal
e55ccc3fe9 add JenkinsFileExistsRule 2019-03-28 14:10:32 +01:00
Alejandra Ferreiro Vidal
1a1a7559d5 rename war properties file 2019-03-28 14:10:32 +01:00
Christopher Fenner
2369573f14
web analytics: use httpRequest step (#587)
* change reporting to use httpRequest step

* Update TelemetryTest.groovy

* adapt tests

* remove import

* avoid NonSerialisableException on HashMap.Entry

* Update Telemetry.groovy

* decrease timeout to 10 seconds

* remove null check

* make helper method static

* fix codeclimate issues
2019-03-28 11:54:45 +01:00
Marcus Holl
5ad99599ab Make use of the step tracker 2019-03-27 16:02:04 +01:00
Marcus Holl
a42e727da2 Create step specific plugin lists: Helper class for tracking step calls
Before the test we remmber which test is currently running.
During the test we collect all the calls to steps.

Beside that we persist the names of all steps within this shared
lib itself.

After the test(s) we write a corresponding json file. In fact we
write the file after each test, which is too often. But since we
don't know which test is the last test we can't do better.

The resulting file can be used later on for resolving the plugins
contributing the particular steps.

With that we are able to create a list of required plugins for each
step.
2019-03-27 16:02:04 +01:00
Marcus Holl
5710ac48ec Introduce step helper 2019-03-27 15:54:25 +01:00
Sven Merk
9466beec42 Fix tests 2019-03-26 17:45:29 +01:00
Oliver Nocon
27c4db47e4
Merge branch 'master' into whitesource-step 2019-03-26 16:46:45 +01:00
Alejandra Ferreiro Vidal
e282c07dd4 remove config.properties file 2019-03-26 14:13:03 +01:00
Sven Merk
56ae339d9c Switch working directory 3 2019-03-26 09:36:59 +01:00
Sven Merk
82d70677fb Refactor to dep as dependency manager 2019-03-25 14:32:36 +01:00
Sven Merk
7de9718e13 Fix interpretation of descriptor 2019-03-25 12:50:00 +01:00
Sven Merk
f928878c5e Fix path handling 2019-03-25 10:38:00 +01:00
Sven Merk
9322769d47 Improve reported version 2019-03-22 14:53:33 +01:00
Sven Merk
b1cf27aa23 Improve test 2019-03-22 14:41:10 +01:00
Sven Merk
8470e14aed Fix Go image 2019-03-22 13:50:11 +01:00
Sven Merk
10c7485808 Fix project name determination for Go 2019-03-22 13:08:48 +01:00
Sven Merk
991dd5ec51
Merge branch 'master' into whitesource-step 2019-03-22 11:58:01 +01:00
Sven Merk
8da169d2a8 Enable golang 2019-03-22 11:55:50 +01:00
Sven Merk
be814c62aa Included comments refactored docu generation 2019-03-21 13:25:22 +01:00
Irina Kirilova
020a5aaadd
Merge branch 'master' into master 2019-03-21 12:54:15 +01:00
Marcus Holl
1f949f27af Fix the unit test 2019-03-21 12:40:38 +01:00
Marcus Holl
3f8498e4dd Merge remote-tracking branch 'github/master' into HEAD 2019-03-21 10:43:27 +01:00
Marcus Holl
1a36a775f4 Fix sanity checks for warPropertiesFile deploy mode. (#574)
* Fix sanity checks for warPropertiesFile deploy mode.

* improve tests for the sanity checks

The sanity checks are performed per deploy mode.
All parameters are checked at once.

* Explict check for host, account not found by sanity checks for deploy mode war properties
2019-03-20 12:14:57 +01:00
Christopher Fenner
80d288ae57
handlePipelineStepError: use ConfigurationHelper (#556)
* use ConfigurationHelper in handlePipelineStepError

* externalise help url
2019-03-20 11:21:06 +01:00
Holger Partsch
94957e2b54 Make K8S integration more configurable (#552)
* Define pod using k8s yaml manifest

The Kubernetes plugin allows to define pods directly via the Kubernetes
API specification:
https://github.com/jenkinsci/kubernetes-plugin#using-yaml-to-define-pod-templates

This has the advantage of unlocking Kubernetes features which are not
exposed via the Kubernetes plugin, including all Kubernetes security
featues.

Using the Kubernetes API directly is also better from development
point of view because it is stable and better desgined then the API the
plugin offers.

* Make the Kubernetes ns configurable

If one Jenkins Master is used by multiple Teams, it is desirable to
schedule K8S workloads in seperatae workspaces.

* Add securityContext to define uid and fsGroup

In the context of the Jenkins k8s plugin it is uids and fsGroups play an
important role, because the containers share a common file system.

Therefore it is benefical to configure this data centraly.

* fix indention

* Undo format changes

* Extend and fix unit tests

* Fix port mapping

* Don't set uid globally

This does not work with jaas due to permissions problems.

* Fix sidecar test

* Make security context configurable at stage level

* Extract json serialization

* Cleanup unit tests
2019-03-20 10:07:37 +01:00
Marcus Holl
ad41c27458 Merge remote-tracking branch 'github/master' into HEAD 2019-03-19 16:05:58 +01:00
Marcus Holl
728464ae54 checkChangeInDevelopment with docker 2019-03-19 10:07:18 +01:00
Marcus Holl
bdc0e487d6 release transport request for cts 2019-03-19 10:07:18 +01:00
Marcus Holl
3e8d4fc576 Release transport SOLMAN with docker 2019-03-19 10:07:18 +01:00
Marcus Holl
71fdcc3e53 docker for upload file SOLMAN 2019-03-19 10:07:18 +01:00
Marcus Holl
24cd9400d7 create transport request SOLMAN with docker 2019-03-19 10:07:18 +01:00
Marcus Holl
620e0c7d4a docker for transportRequestCreate CTS 2019-03-19 10:07:18 +01:00
Marcus Holl
94315bf006 use docker image for cts upload file 2019-03-19 10:07:18 +01:00
Marcus Holl
4d4b9de660 Merge remote-tracking branch 'github/master' into HEAD 2019-03-19 09:06:15 +01:00