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

915 Commits

Author SHA1 Message Date
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
Daniel Kurzynski
af740e1092
Make source for neo deployments configurable in the config file (#564) 2019-03-18 14:55:51 +01:00
Daniel Kurzynski
9f4a597778
Wait for sidecar container to be ready (#567) 2019-03-18 14:05:42 +01:00
Marcus Holl
52f3287cb3 Merge remote-tracking branch 'github/master' into HEAD 2019-03-15 15:01:12 +01:00
Sven Merk
3d81e09ab3 Add warning 2019-03-15 13:32:02 +01:00
Sven Merk
bb31060dad
Merge branch 'master' into whitesource-step 2019-03-15 13:16:29 +01:00
Sven Merk
e37b714c99 Improve coverage 2019-03-15 13:11:34 +01:00
Sven Merk
c96f73866a Refactored to generally migrate config to deep structure 2019-03-14 15:18:01 +01:00
Marcus Holl
9cf49a51cb Merge remote-tracking branch 'github/master' into HEAD 2019-03-14 13:36:10 +01:00
Marcus Holl
d4b0549f74 Merge remote-tracking branch 'github/master' into HEAD 2019-03-14 13:07:30 +01:00
Daniel Kurzynski
9055dd1ea0
Merge branch 'master' into pr/neoDeployParamChecksEarly 2019-03-14 12:52:55 +01:00
Marcus Holl
adafab91e2 Perform parameter validation early, do not truncate parameters
In case of a mis-configuration we get a hint like "host is missing".
Actually it should be "neo/host is missing" since the parameter "host" is nested inside "neo".

Having simply "host" confuses the person troubleshooting this issue.

With this change the input validation is performed right at the beginning of the step.
The NeoCommandLine helper does not check a second time now.
2019-03-13 15:44:57 +01:00
Marcus Holl
7e1c171685
Merge branch 'master' into pr/fixStageDoc 2019-03-13 15:36:28 +01:00
Marcus Holl
201b075cb5 Merge remote-tracking branch 'github/master' into HEAD 2019-03-13 14:36:34 +01:00
Thorsten Duda
28cf46a2fc fix parameter order for instance and client 2019-03-13 14:20:25 +01:00
Marcus Holl
513ceee8cf
Merge branch 'master' into pr/fixStageDoc 2019-03-13 12:39:59 +01:00
Sven Merk
088c5901e7 Improve coverage 2019-03-13 11:38:44 +01:00
Sven Merk
cd8067b5d5 Improve coverage 2019-03-13 11:06:47 +01:00
Sven Merk
6764e75551
Merge branch 'master' into whitesource-step 2019-03-13 10:43:23 +01:00
Sven Merk
39caa29567 Improve coverage 2019-03-13 10:42:54 +01:00
Sven Merk
dee6f61fae Improve coverage 2019-03-13 10:21:41 +01:00
Sven Merk
7dba1dadc9 Improve coverage 2019-03-13 09:58:47 +01:00
Sven Merk
99f853e207 Improve coverage 2019-03-12 23:36:55 +01:00
Sven Merk
1202f4f55a Added test 2019-03-12 23:22:27 +01:00
Sven Merk
46ddaaf137 Add compatibility support for old values 2019-03-12 12:29:30 +01:00
Sven Merk
74a06ef871 Fix test 2019-03-12 11:53:23 +01:00
Christopher Fenner
57911a5835
Merge branch 'master' into pr/fixStageDoc 2019-03-12 11:26:42 +01:00
Sven Merk
61d6280c3a Moved admin auth handling into script 2019-03-11 10:46:22 +01:00
Sven Merk
61a9710fab Fix org admin repo 2019-03-08 14:11:04 +01:00
Daniel Kurzynski
1bd1b01a7a
Merge branch 'master' into remove-compatability 2019-03-07 12:54:04 +01:00
Marcus Holl
a7bc198342 neo toolset not configurable (#484) 2019-03-07 12:53:25 +01:00
Sven Merk
6fd4436494 Fix flattening config compatibility feature 2019-03-07 11:43:08 +01:00
Sven Merk
e6c3d6e4ba Enhance config compatibility feature 2019-03-07 11:13:24 +01:00
Sven Merk
bfbee88620 Added documentation of parameters and step 2019-03-06 15:08:42 +01:00
Sven Merk
d3bfab50f6 Remove confidential information 2019-03-06 14:16:28 +01:00
Sven Merk
cfc3a1528a Implement comments 2019-03-06 14:03:00 +01:00
Sven Merk
df01a88b34 Fix tests 2019-03-06 12:14:38 +01:00
Sven Merk
f7f33f38ac Address comments 2019-03-06 11:04:49 +01:00
Sven Merk
53491ce956 Cleanup and alignment with internal step 2019-03-05 13:59:40 +01:00
Marcus Holl
42d57479d9 Verbose flag for transport request release 2019-03-05 12:35:28 +01:00
Marcus Holl
ad3e0f86d1 Verbose flag for transportRequestCreate 2019-03-05 10:29:23 +01:00
Sven Merk
34857f112f Cleanup 2019-03-04 23:22:15 +01:00
Sven Merk
32b9c95cdb Added tests 2019-03-04 22:55:43 +01:00
Sven Merk
bffb57137a Adapt test 2019-03-04 15:49:55 +01:00
Sven Merk
22096b881a Fix test 2019-03-04 15:32:34 +01:00
Sven Merk
03d3e2b241 Fix missing descriptor support 2019-03-04 15:02:01 +01:00
Sven Merk
05fe2fb758 Cleanup 2019-03-04 14:40:17 +01:00
Sven Merk
58bd5ce7fc Additional tests 2019-03-04 14:08:10 +01:00
Sven Merk
2c00d8cdd0 Switching to official docker images + fixing tests 2019-03-04 11:47:04 +01:00
Sven Merk
14700ba210 Initial checkin of new whitesource step 2019-02-28 13:01:30 +01:00
yemengsap
38c5a0d779 Add npmExecute step (#491) 2019-02-21 19:14:48 +01:00
Oliver Nocon
23d08f0f38
Merge branch 'master' into pr/unstashSkipNull 2019-02-21 16:29:21 +01:00
Florian Wilhelm
ada3ed909d
Don't print messages in all uppercase letters (#531) 2019-02-21 15:46:17 +01:00
Florian Wilhelm
02afb22c74
Change telemetry disabled message to be more kind (#530)
Please, don't use exclamation marks in user interfaces.
2019-02-21 13:56:20 +01:00
Marcus Holl
827d8aa32d imagePull --> pullImage 2019-02-19 11:35:03 +01:00
Marcus Holl
546db7f3f3 Provide verbose flag. 2019-02-15 13:58:11 +01:00
Marcus Holl
a375cc75a5 Provide flag failUploadOnWarning
in order to be able to survive uploads which are basically successful, but
with warning(s).
2019-02-15 13:58:11 +01:00
Florian Wilhelm
d2b6be4e25
Configure default mta build image to ppiper/mta-archive-builder (#515) 2019-02-15 13:48:34 +01:00
weloli
08edf94bd0 Merge branch 'master' of https://github.com/weloli/jenkins-library into pr/fixStageDoc 2019-02-15 09:31:28 +01:00
Marcus Holl
0ea6bdc05c Accept unix style line endings. 2019-02-14 13:52:06 +01:00
Marcus Holl
66fbed80ba Test for rfc create transport sanity checks. 2019-02-14 12:29:13 +01:00
Marcus Holl
d5707db38b Test for rfc create transport requets fails. 2019-02-14 12:22:45 +01:00
Marcus Holl
8aa22d179a Denote use case in test name for creating transport request 2019-02-14 12:04:45 +01:00
Marcus Holl
02e832b008 Test for RFC transportRequestCreate 2019-02-14 12:01:28 +01:00
Marcus Holl
80bd4cf11c Support code page parameter 2019-02-14 09:36:51 +01:00
Oliver Nocon
793df723cf add step slackSendNotification (#338)
* add step slackSendNotification

This step allows to send Slack notifications in case of pipeline failures.

* add SWA reporting

* remove allowBuildFailure

* add GENERAL_CONFIG_KEYS

* update STEP_NAME

* add missing import

* fix MD findings

* adjust rule name to be aligned with #455
2019-02-13 16:45:35 +01:00
Marcus Holl
af5d67aaf7 docker params as map when releasing tr via rfc 2019-02-13 14:58:46 +01:00
weloli
72adaf3dd5 Merge branch 'master' of https://github.com/weloli/jenkins-library into pr/fixStageDoc 2019-02-13 14:35:56 +01:00
Marcus Holl
5f07490cf2 Unstash in loop only if identifier is available
In case unstashAll is called with a Set containing a null value we get
an ugly message in the log:

Unstash failed: null (Could not instantiate {name=null} for UnstashStep(name: String):

This can be avoided by unstashing only in case we have an ID.
2019-02-13 14:31:25 +01:00
weloli
8d48582033 adapt test to changed expectation 2019-02-13 14:01:56 +01:00
Marcus Holl
2d7079a8c9 Merge remote-tracking branch 'github/master' into HEAD 2019-02-13 09:05:28 +01:00
Marcus Holl
ff88bfa79f Merge remote-tracking branch 'github/master' into HEAD 2019-02-13 08:51:26 +01:00
weloli
e4c73d0100 add test to prove wrong documentation 2019-02-12 16:56:06 +01:00
Marcus Holl
0ae673c021 docker params as map when creating tr via rfc 2019-02-12 15:35:27 +01:00
Marcus Holl
dc1dfd622c docker params as map for fileUpload 2019-02-12 15:22:22 +01:00
Marcus Holl
9305a52d0f Merge remote-tracking branch 'github/master' into HEAD 2019-02-08 12:38:59 +01:00
Christopher Fenner
d657f0dc28
testsPublishResults: add option to fail the build on test errors (#472)
* add option to fail the build on test errors

* fix typo

* add test cases

* adjust docs

* set build result

* add hasTestFailure utils method

* use utils method

* use dedicated type

* adapt tests

* handle missing test actions

* Update testsPublishResults.md

* Update JenkinsUtils.groovy

* Update JenkinsUtils.groovy

* Update JenkinsUtils.groovy

* remove comments

* adapt test case

* Update TestsPublishResultsTest.groovy
2019-02-08 12:30:59 +01:00
Marcus Holl
8b13164d74 [fix] remove inapproriate package statement (#497)
The test class is in the default package and not in a package 'steps'.
2019-02-08 12:03:41 +01:00
Marcus Holl
fe147eff81 Handle parameters as env vars instead of options for RFC upload
options are not supported for dockerExecuteOnKubernetes, but
environment variables are. Hence we switch to environment variables
which works on both, plain docker and on kubernetes.

Using env vars is the cleaner approach anyway.
2019-02-08 12:03:05 +01:00
Marcus Holl
d369d3cd4a Remove println statements from tests
Nobody will have a look at println statements emitted by tests. Proper way is to assert.

* log is empty, not sure if it makes sense to assert that the log is empty.
* result is already asserted, so everything is fine there ...
2019-02-07 17:03:32 +01:00
Marcus Holl
6b4d2ba33e Remove println statements from default registered sh closure
We should try to avoid promting statements to the log during tests. This is basically
some kind of manual/visual checking of conditions. This does not work since in most cases
nobody scans test logs manually/visually. I think this is often a smell for missing assertions.
2019-02-07 16:58:49 +01:00
Marcus Holl
8d1786fa8d DevelopmentInstance for upload file rfc 2019-02-07 11:46:45 +01:00
Marcus Holl
3a982a8f04 provide developent instance for transportRequest release RFC 2019-02-07 11:24:39 +01:00
Marcus Holl
e9c1834f9d Provide development instance for create transport request RFC 2019-02-07 11:12:17 +01:00
Marcus Holl
d8d2d8b1fd abap development client always under changeManagement.rfc 2019-02-07 10:11:22 +01:00
Marcus Holl
fd5a07d403 applicationId -> applicationName for RFC file upload 2019-02-07 08:29:53 +01:00
Marcus Holl
200e18f468 transportRequestRelease sanity checks for CTS case. 2019-02-06 15:31:50 +01:00
Marcus Holl
608b76f1c8 transportRequestRelease sanity checks for SOLMAN case. 2019-02-06 15:16:27 +01:00
Marcus Holl
663b840dee Add test for release transport CTS success 2019-02-06 14:23:00 +01:00
Marcus Holl
1b202f879a Provide flag for skipping docker image pulls (#407)
* Provide flag for skipping docker image pulls

Usefull for testing while developing images. Without pulling images it is possible to
use images available in the local registry only.
2019-02-06 08:48:33 +01:00
Marcus Holl
d8b0de3735 Add step test: transportRequestRelease for CTS fails 2019-02-05 17:29:45 +01:00
Oliver Nocon
74366631b5
Project "Piper" Template: framework and structure (#476)
* Project "Piper" Template: framework and structure

This is the first in a series of Pull-Requests to provide a fully functional Pipeline template into the library.

This PR contains:
* general Pipeline structure incl. tests
* Pipeline initialization incl. tests
* Hollow pipeline stages incl. tests
* first set of default values
* add gitUrls to commonPipelineEnvironment
* set correct git information on commonPipelineEnvironment
2019-02-05 15:37:59 +01:00
Marcus Holl
6f96f3d87b Add test for transportRequestRelease failure for type RFC 2019-02-01 13:29:41 +01:00
Marcus Holl
59bff987d7 Test for releaseTransportRequest RFC sanity checks 2019-02-01 13:23:08 +01:00
Marcus Holl
0d2dec0922 Introcude test transportRequest RFC release 2019-02-01 13:08:25 +01:00
Marcus Holl
cb61d80e12 development client for RFC release transport not hard coded anymore 2019-02-01 13:08:25 +01:00
Marcus Holl
c785e53317 split releaseTransportRequest method into three methods
one for each BackendType.
2019-02-01 13:08:24 +01:00
Marcus Holl
6072bbd280 Remove outdated comment from test class 2019-01-31 14:12:05 +01:00
Marcus Holl
6a6e075da8 Provide test for transport request create rfc fails 2019-01-31 14:02:54 +01:00
Marcus Holl
71148faa42 Test for create transport request via RFC succeeds. 2019-01-31 13:06:52 +01:00
Marcus Holl
3ea0cb6208 Remove duplicate test
the other test doing the same is testReleaseTransportRequestFailsSOLMAN
2019-01-31 12:38:46 +01:00
Marcus Holl
5302d1d7b1 Merge remote-tracking branch 'github/master' into work 2019-01-31 09:55:21 +01:00
Marcus Holl
06f48ce5e7 Test failure case RFC upload ChangeManagement 2019-01-31 09:39:34 +01:00
Oliver Nocon
3b2e42c74f
Add step containerExecuteStructureTest (#441)
* add step containerExecuteStructureTest
* include PR-review feedback
* documentation
2019-01-31 09:39:13 +01:00
Marcus Holl
80c7da76f4 Test good case RFC upload ChangeManagement 2019-01-31 09:31:52 +01:00
Christopher Fenner
bca5b8ccf1
Add step uiVeri5ExecuteTests (#469)
* add defaults for uiVeri5 step

* add step and tests

* correct parameter names

* add empty docs

* add docs annotations

* remove not needed parameter

* add docs annotations
2019-01-31 09:16:34 +01:00
Marcus Holl
01cdfc5d91 Make clear in the testName which type we test. 2019-01-31 09:06:02 +01:00
Marcus Holl
34b0e1f4f5 RFC: upload failure test 2019-01-30 17:34:16 +01:00
Marcus Holl
40d89f2e5d Test: sanity check parameters 2019-01-30 17:34:16 +01:00
Marcus Holl
dfe69d7a31 Test: upload rfc success 2019-01-30 16:57:25 +01:00
Marcus Holl
a70fc10ae0 Parameter applicationURL instead of file path 2019-01-30 16:02:48 +01:00
Marcus Holl
ce710dfa38 More consistent test names for transportRequestUploadFile 2019-01-30 15:13:10 +01:00
Marcus Holl
88d50a0a10 Fix error message: cmclient, rfc client 2019-01-30 15:13:10 +01:00
Marcus Holl
661745fd81 Merge remote-tracking branch 'github/master' into HEAD 2019-01-30 15:01:09 +01:00
Christopher Fenner
def66f4ffa
extend Analytics (#439)
* add extension mechanism for analytics

* add sha1 hashing

* correct return types

* correct registerEventListener method

* decrese visibility of createInstance

* correct typo

* catch exceptions from tests

* correct test case

* Update Analytics.groovy

* rename to Telemetry

* rename file

* fix typo

* add test case for generateSha1

* expose methods to tests

* add clear method for tests

* change return type

* add test for Telemetry class

* replace UtilsTests

* remove unused imports

* make default reporter static

* add stage parameters to payload

* simplify SHA1 method

* remove obsolete method

* remove obsolete methods

* remove outdated tests
2019-01-30 12:39:33 +01:00
Florian Geckeler
a72e33f488
Stop old instance only if it exists in CloudFoundry
If there was no instance deployed in CF and blue-green deployment was activated stopping the old instance caused a failure of the pipeline, even if the application was deployed successfully. 
With that change the failure of the pipeline will be avoided in case of no old application is available.
2019-01-30 10:07:00 +01:00
Bernd Maier
c7a6b073fc RFC release transport 2019-01-29 14:57:31 +01:00
Daniel Kurzynski
09a2e3f090 Remove compatibility for neoDeploy 2019-01-28 12:35:35 +01:00
Daniel Kurzynski
6e26d78047
Improve neo deploy (#440)
The following features were added:
Lock resources for deployment
New parameters: environment, vmArguments
Assert password does not start with @
Link to cloud cockpit
Only execute rolling update if app is running
Show logs if deployment failed
Restart app after normal deployment
Use neo namespace for parameters
Align parameter names with neo sdk: size, application, source
Remove vmSize check as done by the tool itself
2019-01-28 11:32:24 +01:00
Christopher Fenner
152c0e3682
Merge branch 'master' into pr/betterReadableRuleNames 2019-01-23 16:53:52 +01:00
Marcus Holl
ddc796b85d Better readable rule names: readJsonRule 2019-01-23 14:54:52 +01:00
Marcus Holl
9e56ebc724 Better readable rule names: dockerExecuteRule 2019-01-23 14:54:52 +01:00
Marcus Holl
f81b83169a Better readable rule names: readFileRule 2019-01-23 14:54:52 +01:00
Marcus Holl
e4c3228e25 Better readable rule names: writeJsonRule 2019-01-23 14:54:51 +01:00
Marcus Holl
7ba695e767 Better readable rule names: readJsonRule 2019-01-23 14:54:51 +01:00
Marcus Holl
da1969e089 Better readable rule names: writeFileRule 2019-01-23 14:54:51 +01:00
Marcus Holl
afa8889e9d Better readable rule names: errorRule 2019-01-23 14:54:51 +01:00
Marcus Holl
5c0abfdff8 Better readable rule names: readYamlRule 2019-01-23 14:54:51 +01:00
Marcus Holl
4e01b94458 Better readable rule names: dockerExecuteRule 2019-01-23 14:54:50 +01:00
Marcus Holl
b486f32dc1 Better readable rule names: stepRule 2019-01-23 14:54:50 +01:00
Marcus Holl
9b1397e998 Better readable rule names: loggingRule 2019-01-23 14:54:50 +01:00
Marcus Holl
994e1f1692 Better readable rule names: shellRule 2019-01-23 14:54:49 +01:00
Marcus Holl
9bf38f9a76 Merge remote-tracking branch 'github/master' into HEAD 2019-01-23 14:26:30 +01:00
Oliver Nocon
05e0d958da
dockerExecute - fix issue when image does not contain which (#458)
command `which` requires a dedicated OS package to be installed.
In case a Jenkins Master or Jenkins Slave Image does not contain `which`, although `docker` command is available the step took a wrong turn.

This removes the check using `which` since checking `docker ps` is sufficient.
2019-01-23 14:19:36 +01:00
Marcus Holl
2330bfdcf4 Merge remote-tracking branch 'github/master' into HEAD 2019-01-23 12:34:25 +01:00
Oliver Nocon
27c3891685
deployToCloudFoundry - patch mta blue-green deployment (#457)
mta deploy plugin has flag:
` --no-confirm` which is described as _"Do not require confirmation for deleting the previously deployed MTA apps"_

This flag is essentials for performing fully automated blue-green deployments.
2019-01-22 16:13:59 +01:00
Marcus Holl
c8c96f11e3 Escape blanks when contained in env values for docker 2019-01-18 15:48:58 +01:00
sbmaier
423c9f52ba cloudFoundryDeploy: fix naming of Influx step (#450)
* fix naming Influx

* fix test for influx name change
2019-01-18 15:33:36 +01:00
Christopher Fenner
f6647d9ce5
newmanExecuteTests: use user-specific .npm-global directory (#447)
* use user-specific .npm-global directory

* Update newmanExecute.groovy

* fix typo

* Update NewmanExecuteTest.groovy

* Update NewmanExecuteTest.groovy
2019-01-18 13:14:39 +01:00
Marcus Holl
0914f6920a no docker pull 2019-01-18 10:26:27 +01:00
Marcus Holl
cca46d509b Upload binaries to transport requests via RFC 2019-01-18 10:26:03 +01:00
Oliver Nocon
e11478ca00
cloudFoundryDeploy - add deployment reporting to Influx (#421)
Add reporting of operations-related data to Influx (if configured), like:
* Version of deployed artifact
* Deployment time
* Target infrastructure for deployment
2019-01-18 08:25:22 +01:00
Oliver Nocon
98139bb498
influxWriteData - support Influx tags (#420)
* influxWriteData - support Influx tags

In order to better query data in Influx, tags needs to be written.
This change allows filling tag data via the Influx plugin.
2019-01-17 15:42:03 +01:00
Marcus Holl
db5022a4ff New Scenario Step: SAP UI5 on SAP Cloud Platform (#388)
This scenario builds a UI5 app and deploys it to SAP Cloud Platform (neo).
2019-01-15 13:32:01 +01:00
Oliver Nocon
20a54cf094
dockerExecute - extend Kubernetes capabilities (#432)
allow `dockerExecute` to pass on to dockerExecuteOnKubernetes
* containerCommand
* containerShell
2019-01-14 14:43:07 +01:00
Oliver Nocon
4064e6ffe1
piperStageWrapper - switch to parameter map for extensions (#424)
switch to using a parameter map
2019-01-14 10:25:47 +01:00
Oliver Nocon
724a851bcd
executeDockerOnKubernetes - specify custom shell (#428)
Depending on the Docker image used the default shell will not work in certain cases.
This extends the executeDockerOnKubernetes step to be able to use a custom shell according to https://github.com/jenkinsci/kubernetes-plugin#specifying-a-different-shell-command-other-than-binsh
2019-01-08 19:44:28 +01:00
Marcus Holl
d6372d5d96 Merge remote-tracking branch 'github/master' into HEAD 2018-12-19 13:18:00 +01:00
Oliver Nocon
130e607446
influxWriteData - fix issue when running in POST (#413)
influxWriteData requires a node to be executed.
In a declarative pipeline the POST section by default does not provide a node/agent.

This adds a parameter to force creation of a node/agent.
2018-12-12 17:33:36 +01:00
Marcus Holl
0751eda1ee Merge remote-tracking branch 'github/master' into HEAD 2018-12-12 12:24:26 +01:00
Marcus Holl
45170e979e Adapt mta build test test JenkinsShellCallRule
a lot of code can be replaced by configuring the JenkinsShellCallRule accordingly. At the time when
this test was provided there was not JenkinsShellCallRule ...
2018-12-12 12:14:14 +01:00
Marcus Holl
bf881bfc13 Merge remote-tracking branch 'github/master' into HEAD 2018-12-12 12:05:24 +01:00
Oliver Nocon
e556fba950
add wrapper for stages contained in library (#341)
* add wrapper for stages contained in library

`piperStageWrapper` provides a wrapper for stages which we may include into the library.
It will take care about extension capabilities, locking, node handling, ... which should be a capability of every stage contained in the library.
2018-12-12 11:45:11 +01:00
Marcus Holl
51afc894e5 Implement hashCode/equals/toString for JenkinsShellCallRule
* toString is helpful for troubleshooting during developing tests
* equals/hashCode are required in case somebody would like to register
  some responses again (e.g. register something valid almost all the time, and
  register something more specific for a certain test).
2018-12-10 16:23:24 +01:00
thorstenwillenbacher
4d06cf151e
Merge branch 'master' into pr/moreLoggingAndFailfastInMtaBuild 2018-12-06 15:12:46 +01:00
Marcus Holl
dc780b1248 [fix] Make regex in test Operating System independent.
We searched for the slash, but on win like operating system we have of course a backslash.
2018-11-28 11:52:37 +01:00