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

948 Commits

Author SHA1 Message Date
Thorsten Duda
7a9c5c9445
Merge branch 'master' into pr/allCPEsCanBeUsed2 2019-11-12 12:16:33 +01:00
Shanuson
8f723caa31 Fix bug and added documentation for cloudFoundryCreateService step (#967)
* fix bug with wrong plugin parameter used
* provided default value for stash-content
* added documentation for step
2019-11-12 10:29:08 +01:00
Thorsten Duda
d77f0f8fac
Merge branch 'master' into pr/allCPEsCanBeUsed2 2019-11-12 07:56:29 +01:00
Oliver Nocon
da0935c0e5
Patch Urls (#929)
* Patch Urls
* fix test
2019-11-11 17:40:23 +01:00
Sven Merk
c9dcfd5578 Fix comment format 2019-11-11 11:08:20 +01:00
Daniel Mieg
2e0bf3ac34 Add step to pull repository to ABAP in SAP Cloud Platform (#907) 2019-11-07 15:40:45 +01:00
Marcus Holl
2a6c075001
streamline git url retrieval (#850)
* Streamline url parsing in piperPipelineStageInit

* Remove .git appendix only once

* Improve the regex for parsing urls

now the colon for the port is contained in the port group. This increases the
understandability of the regex.

* Improve the regex for parsing the urls again

now the leading slash of the path is contained in the path group. This increases the
understandability of the regex.
2019-11-07 15:37:27 +01:00
Stengel
73b931441c Merge remote-tracking branch 'upstream/master' into harmonize-docker-arguments 2019-11-07 11:20:54 +01:00
rodibrin
620efb3d8b
Merge branch 'master' into eclipsecomplains 2019-11-06 15:42:11 +01:00
Oliver Nocon
a04489cd35
Add step spinnakerTriggerPipeline (#793) 2019-11-06 15:37:14 +01:00
Stengel
1dbe7352c7 Merge remote-tracking branch 'upstream/master' into harmonize-docker-arguments 2019-11-06 10:02:58 +01:00
Stengel
31d8ddb719 Map with single parameter 2019-11-04 13:46:30 +01:00
Sven Merk
0f3436d1a5 sonarExecuteScan: avoid working directory being deleted before scan detection ends (#882) 2019-10-28 13:01:51 +01:00
Sven Merk
bb59e68df3 sonarExecuteScan: Fix links in documentation (#883)
* Update sonarExecuteScan.groovy

* Update sonarExecuteScan.groovy

* Update vars/sonarExecuteScan.groovy

* Update vars/sonarExecuteScan.groovy
2019-10-28 12:55:27 +01:00
Daniel Kurzynski
462c293c9c User piper docker images (#920) 2019-10-25 17:49:54 +02:00
Stengel
fdf2d97f9a Merge remote-tracking branch 'upstream/master' into harmonize-docker-arguments 2019-10-24 07:37:13 +02:00
Sven Merk
a16ca05669
Merge branch 'master' into fix-non-serializable 2019-10-23 14:34:06 +02:00
Marcus Holl
3046f121c1
Check against containerMap from config rather than params (#835)
The parameter map is directly handed over from outside into the step via signature of the call method.

The container map is defined as step parameters, not as parameter handed over (only) via the parameters map.

With the current approach only the container map from the parameters is taken into account. In case the
parametersMap is defined elsewhere it is not taken into account.
2019-10-23 14:31:49 +02:00
Sven Merk
46fb4ad5e8 Exchange NonSerializable template engine with GStringTemplateEngine 2019-10-23 13:38:31 +02:00
Marcus Holl
8e987c46e1
[refactoring] condence common coding for cf deploy (#895)
* [refactoring] condence common coding for cf deploy

Small change beyond refactoring: for mtaDeploy the user is now quoted.

* more general name: logoutAction -> postDeployAction
2019-10-22 13:53:08 +02:00
Marcus Holl
514755e4ef
Fail early if file which should be uploaded does not exist. (#909)
Right now we fail with some error message from curl.
2019-10-22 12:28:43 +02:00
Shanuson
8cfac8d43f new step cloudFoundryServiceCreate (#892)
# Changes
This PR adds a new step: cloudFoundryServiceCreate

There is a cf community plugin [Create-Service-Push](https://github.com/dawu415/CF-CLI-Create-Service-Push-Plugin) available to apply infrastructure as code  to Cloud Foundry. The plugin uses a manifest.yml to create services in a targeted CF space. 

The proposed step provides an interface to this plugin. 

Already done:
- [x] Tests
- [x] Documentation

Further actions:
- a Refactoring: Move varOptions and varsFileOption code into a class and make us of this here and in cloudFoundryDeploy step. -> Is it ok to use the CfManifestUtils, or add it as a new class to variablesubstitiion package? 
- enhance the s4sdk cf cli docker image to include the plugin.
2019-10-22 11:15:03 +02:00
Sven Merk
5bf5a6013c
Update whitesourceExecuteScan.groovy 2019-10-17 15:24:09 +02:00
Sven Merk
3d1da388c8
Update whitesourceExecuteScan.groovy 2019-10-16 14:58:54 +02:00
Sven Merk
cf64a0d098
whitesourceExecuteScan: Transfer logs into workspace to allow archiving 2019-10-16 13:49:47 +02:00
Sven Merk
88ab65cf7b Fix UA log path for archiving 2019-10-16 10:54:17 +02:00
Sven Merk
79348f68de Add archiving of new UA log files 2019-10-15 11:50:35 +02:00
Marcus Holl
8b26406fc7
Provide additional opts for cf deploy (#872)
* Provide additional opts for cf deploy

Inside cloudFoundyDeploy we use these cf commands

 o login
 o plugins
 o blue-green-deploy
 o push
 o deploy
 o bg-deploy
 o stop
 o logout

 o logout and stop does not provide any options
 o plugins provides options (--checksum --outdated) but it is unlikely that
   these options can be used in a reasonable way during the deploy process.
 o login now uses `loginOpts`
 o The other commands uses now `deployOpts`

* provide additional opts also for cf api calls

* Provide more log when verbose

* re-use mtaDeployParameters and adjust names of other params (api, login) accordingly

* Streamline naming

* distinuish between cfNative and mta deploy params

* Add cfNativeDeployParam default

* login and api paramters are not under cloudFoundry
2019-10-02 13:28:54 +02:00
Marcus Holl
facebdbdbb
Provide the logs for cf deploy (#865)
* Provide the logs for cf deployx

* Surround cf trace output by comments so that it can be easily retrieved

* Tests
2019-09-27 16:10:43 +02:00
Marcus Holl
149cd96dbf Back commonPipelineEnvironment step by shared class 2019-09-27 13:54:58 +02:00
Marcus Holl
e418c15b6e
Revert "Back commonPipelineEnvironment step by shared class (#821)" (#885)
This reverts commit eb57c8df7b.
2019-09-26 14:18:18 +02:00
Marcus Holl
eb57c8df7b
Back commonPipelineEnvironment step by shared class (#821)
* Back commonPipelineEnvironment step by shared class

Each pipeline step comes with its own instance of a commonPipelineEnvironment.
Properties stored on one instance was not shared with the other instances.

Now we strip down the commonPipelineEnvironment step and forward basically
everything to a shared singleton instance.

With that approach all instances of commonPipelineEnvironment shares the
same data and can now be really used for information exchange between the steps.
Before that change only the commonPipelineEnvironment instance associated with
the pipeline script itself could be used for that purpose.

* Remove unneeded commented line
2019-09-26 12:23:36 +02:00
TheFonz2017
6dabdff8d5 Added (optional) Variable Substitution to CloudFoundryDeploy Step (#866) 2019-09-24 08:49:25 +02:00
Shanuson
05301eaf16 Refactoring Only PR for cloudFoundryDeployStep (#881) 2019-09-20 09:57:28 +02:00
Sven Merk
fce8098f98 Avoid full merge trace being added to culprits 2019-09-16 10:02:21 +02:00
Florian Geckeler
565ac99742 Handle sidecar parameters in dockerExecuteOnKubernetes (#869) 2019-09-12 10:52:05 +02:00
Marcus Holl
e54f18e6bc
Introduce xsDeploy step (#749)
Introduce xs deploy
2019-09-11 13:42:38 +02:00
TheFonz2017
41dcebb3a5 Variable Substitution in YAML Files (#852)
* Changes:
- New YamlSubstituteVariables step to substitute variables in YAML files with values from another YAML
- New Tests, that check the different substitution patterns.
- Added test resources, including various manifest and variables files.
- Improved usage of JenkinsLoggingRule
- Improved JenkinsReadYamlRule to properly reflect the mocked library's behaviour.
- Added a new JenkinsWriteYamlRule.

* Changes:
- added a Logger that checks a config.verbose flag before it logs debug messages.
- changed error handling to rethrow Yaml parsing exception in case of wrongly-formatted Yaml files.
- changed JenkinsWriteYamlRule to capture Yaml file details of every invocation of writeYaml. This allows sanity checks at end of tests, even if there were multiple invocations.
- adjusted tests.

* Changes:
- Removed javadoc-code blocks from API documentation since they are not supported.
- Removed skipDeletion boolean.
- Added a new deleteFile script which deletes a file if present.
- Added a new JenkinsDeleteFileRule to mock deleteFile script and optionally skip deletion for tests.
- Adjusted yamlSubstituteVariables script.
- Adjusted tests to include new JenkinsDeleteFileRule.
- Changed code that deletes an already existing output file to produce better logs.

* Changes:
- Turned yamlSubstituteVariables into a script that works purely based on Yaml data (not files).
- Added a new cfManifestSubstituteVariables that uses yamlSubstituteVariables under the hood but works based on files.
- Adjusted tests, and added new ones.

* Adjusted documentation and a few log statements.

* Changed documentation to no longer include javadoc code statements.

* Made mocking of deletion of a file a default. Adjusted tests.

* Changed signature of yamlSubstituteVariables' call method to return void.

* Changes:
- Fixed naming issues in deleteFile.
- Renamed Logger to DebugHelper.
- Fixed some documentation.

* Changed implementation of deleteFile not to use java.io.File - which is evil when using it for file operations.

* PROPERLY Changed implementation of deleteFile not to use java.io.File - which is evil when using it for file operations.

* Changes:
- Added tests for deleteFile script
- Changed JenkinsFileExistsRule to also keep track of which files have been queried for existence.

* Changes:
- Removed java.io.File usage from cfManifestSubstituteVariables and using fileExists instead now.
- Adjusted tests.

* Wrapped file path inside ticks to allow spaces in file path when calling deleteFile.

* Removed null checks of mandatory parameters, and resorted to ConfigurationHelper.withMandatoryProperty

* Fixed a NullPointer due to weird Jenkins / Groovy behaviour.

* Changes:
- Turned yamlSubstituteVariables step into a utils class.
- Added tests
- Adjusted cfManifestSubstituteVariables to use utils class instead of step.
- Adjusted tests
- Adjusted APIs of DebugHelper.

* Re-introduced log statement that shows what variables are being replaced and with what.

* Changing API of YamlUtils to take the script and config as input.

* Test

* Test

* Test

* Test

* Test

* Fixing issue.

* Fixing issue.

* Changes:
- Refactored DebugHelper and YamlUtils to make usage nicer and rely on dependency injection.
- Removed Field for DebugHelper and turned it into local variable.
- Adjusted classes using the above.
- Adjusted tests where necessary.

* Added link to CF standards to YamlUtils also.

* Add docu for step cfManifestSubstituteVariables.md

* Added documentation.

* Added missing script parameter to documentation. Some steps document it, some don't. Right now you need it, so we document it.

* Fixed some layouting and typos

* Beautified exception listing.

* Removed trailing whitespaces to make code climate checks pass.

* Trying to get documentation generated, with all the exceptions to markup one should not use.

* cosmetics.

* cosmetics, part 2

* Code climate changes...

* Inlined deleteFile step.

* Added two more tests to properly check file deletion and output handling.

* Changes:
- adjusted API to take a list of variables files, as does 'cf push --vars-file'
- adjusted API to allow for an optional list of variable key-value-maps as does 'cf push --vars'
- reproduced conflict resolution and overriding behavior of variables files and vars lists
- adjusted tests and documentation

* Added missing paramter to doc comment.

* Re-checked docs for missing paramters or params that have no counterpart in the method signature.

* Adjusted documentation.

* Removed absolute path usage from documentation.

* corrected documentation.

* Changed javadoc comment to plain comment.

* Turned all comments to plain comments.
2019-09-06 10:20:35 +02:00
Hans Schulz
8cb5779f5d Fix imagePullPolicy always being IfNotPresent when executing single container (#834)
* Update dockerExecuteOnKubernetes.groovy

* Update dockerExecuteOnKubernetes.groovy
2019-08-21 15:04:20 +02:00
Marcus Holl
d2d4232883
Remove useless utils from signature inside neoDeploy (#853) 2019-08-21 13:10:54 +02:00
Marcus Holl
8c966e41c4
more precise param handover (gitUrl) in piperPipelineStageInit (#848)
Before: complete scmInfo was handed over via method signature.

After: Only the relevant part (GIT_URL from scmInfo) is handed over.

All the other properties from scmInfo are not used in the method body.
With this appraoch it is more obvious what is used inside the method.
2019-08-20 09:08:42 +02:00
Florian Geckeler
f69eac6f5f Pass configured env vars to docker execution in existing container (#851) 2019-08-16 17:05:18 +02:00
Oliver Nocon
fa3b6b68db
githubPublishRelease - add templating capabilities (#849)
add templating capabilities for the header in the release information
2019-08-15 15:26:08 +02:00
Oliver Nocon
023f35c0a8
dockerExecuteOnKubernetes - add stashBack configuration (#808)
* dockerExecuteOnKubernetes - add stashBack configuration

For certain cases it is valuable to only bring back some of the files from an execution inside a container back to the workspace.
This is now added.

Closes #753

* refactor according to PR review
2019-08-14 16:44:12 +02:00
Christopher Fenner
f3f4c741be
sonarExecuteScan: add custom certificate support (#819)
* feat(sonar): load TLS certificates

* allow verbose property

* handle whitespaces

* cleanup

* disable default verbosity on wget

* correct test file name

* add test case for custom certificates

* import StandardCharsets

* change cleanup

* correct pull-request provider name

* correct pull-request provider name

* correct pull-request provider name
2019-08-11 22:42:34 +02:00
Oliver Feldmann
af5c16ef46
setupCommonPipelineEnvironment: support yaml config file ending (#811)
* Allow for yaml file ending

* Format code
2019-07-31 12:22:26 +02:00
Christopher Fenner
7845e18f4d
fix NonCPS issues (#796)
* remove NonCPS statement

* remove NonCPS anntotation

* fix typo

* remove NonCPS anntotation

* remove NonCPS anntotation

* remove NonCPS anntotation

* remove NonCPS anntotation

* remove NonCPS anntotation

* remove Iterable

* remove mixins

* add mixins

* add mixins 2

* add mixins 3

* add NonCPS anntotation

* remove tokenize

* remove closure

* remove closure

* replace closure

* use Object

* use Object

* use Object

* remove object

* remove object

* add logic

* change type

* change type

* remove NonCPS anntotation

* remove NonCPS anntotation

* add import
2019-07-29 10:17:56 +02:00
Oliver Nocon
0c3e5f1ea9
use new unstable step to better visualize pipeline errors (#804)
With https://jenkins.io/blog/2019/07/05/jenkins-pipeline-stage-result-visualization-improvements/ it has been made possible to allow for a better visualization in case certain pipeline stages are 'UNSTABLE'

This is about using the new feature if available with a fall-back to old behavior.
2019-07-26 17:40:22 +02:00
Oliver Nocon
153dbf2a7f
githubPublishRelease - ensure proper JSON encoding (#807)
So far some special characters have not been properly encoded when creating a release.
This is addressed by using a new JsonUtils method now.
2019-07-26 14:03:20 +02:00
Roland Stengel
db8f9d0f07 harmonize docker configuration properties
fixes
2019-07-25 12:12:34 +02:00
Roland Stengel
01ce797245 harmonize docker configuration properties
support the configuration of the docker arguments

  dockerEnvVars
  dockerOptions
  dockerWorkspace

for all steps.
2019-07-25 11:57:21 +02:00
Sven Merk
b1b480a7e1
Merge branch 'master' into whitesourceExecuteScan 2019-07-19 14:28:26 +02:00
tobiaslendle
cb245b1ce2 TMS integration (#782) 2019-07-18 15:06:11 +02:00
Christopher Fenner
5bf7cda940
add new step piperPublishNotifications (#652)
* add new step for notification publication

* add test cases

* add helper method

* correct import

* Update pom.xml

* add step to post section

* add step piperPublishNotifications

* move step to end of pipeline to gather all findings

* use handlePipelineStepErrors step

* use commonPipelineEnvironment

* correct reporting

* add configuration

* fix typos

* fix rule setup

* remove test scope

* add method to fetch full build log

* add methods for warnings-ng parser creation

* remove warnings plugin coding

* add default parser settings

* change parameter handling for parser creation

* adapt step

* fix parser creation

* use ParserConfig.contains

* use correct parameter name

* correct parser regex

* change issue creation

* use classloader

* fix typo

* Revert "fix typo"

This reverts commit 446a201ae4.

* Revert "use classloader"

This reverts commit a896487032.

* rename step to piperPublishWarnings

* extract recordIssuesSettings to defaults

* make addWarningsNGParser non-static

* remove node

* adjust test case

* add docs

* rename log file

* fix tests

* fix typos

* rename parameter

* add import for IOUtils

* check plugin activation

* add comment for class loader usage
2019-07-18 12:09:54 +02:00
Sven Merk
a5170bb878
Merge branch 'master' into whitesourceExecuteScan 2019-07-18 09:50:38 +02:00
Oliver Nocon
be33eccbec
Take proper jnlp image as default for Kubernetes execution (#759)
* Take proper jnlp image as default for Kubernetes execution

Following changes are contained:

* removal of custom jnlp image as default
* allow customization of jnlp image via system environment

fixes #757

* add documentation
2019-07-17 12:01:24 +02:00
Sven Merk
7fbf7ffdf1
Merge branch 'master' into whitesourceExecuteScan 2019-07-17 10:56:47 +02:00
Oliver Nocon
31b9874eff
githubPublishRelease - properly handle situation where no release exists yet (#792)
correct error handling to properly take care of non-existing initial release.
2019-07-16 20:31:46 +02:00
Marcus Holl
7b987ea2a2 Fix missing closing bracket in comment 2019-07-16 16:46:04 +02:00
Marcus Holl
68a4c550af typo, whitespace fix 2019-07-16 16:41:21 +02:00
Marcus Holl
6d3c6aab32 gitSshUrl only mandatory for git push mode SSH 2019-07-16 16:30:47 +02:00
Marcus Holl
1861babdd1 docu: gitHttpsUrl mandatory only for gitPushMode https 2019-07-16 16:25:18 +02:00
Marcus Holl
30c632f29a rename debug to verbose et al. 2019-07-16 16:01:43 +02:00
Marcus Holl
2f7fa6e4a4 Provide defaults 2019-07-16 15:45:08 +02:00
Marcus Holl
96758a8c75 Fix code climate issues 2019-07-16 15:36:52 +02:00
Marcus Holl
7084134bfc cleanup 2019-07-16 15:20:27 +02:00
Marcus Holl
ae34803025 Ensure passwords are not leaked directly in debug mode when url encoding alters password 2019-07-16 14:08:39 +02:00
Marcus Holl
fa188c06b3 remove unset proxies 2019-07-16 11:43:24 +02:00
Marcus Holl
c24aab5640 more git debug output 2019-07-16 11:41:34 +02:00
Marcus Holl
bbaf8949df fix disabling ssl verifiction check again 2019-07-16 11:35:10 +02:00
Marcus Holl
5e24102130 fix disabling ssl verifiction check 2019-07-16 11:34:01 +02:00
Marcus Holl
39129aeecb troubleshoot proxy 2019-07-16 11:30:39 +02:00
Marcus Holl
7396b2f6ce Fix typo 2019-07-16 11:28:02 +02:00
Marcus Holl
445e28a58b Print proxy related environment variables 2019-07-16 11:26:49 +02:00
Marcus Holl
96af04a8ca fix invalid quotation 2019-07-16 11:19:03 +02:00
Marcus Holl
2c9a3c2924 fix invalid comma 2019-07-16 11:18:08 +02:00
Marcus Holl
14a355def5 Make git more verbose in debug mode. 2019-07-16 11:11:59 +02:00
Marcus Holl
daf5d3340e more tests 2019-07-12 17:01:33 +02:00
Marcus Holl
3f48243632 fix typo 2019-07-12 13:42:16 +02:00
Marcus Holl
8090219931 fix type 2019-07-12 13:42:16 +02:00
Marcus Holl
be929e6c10 Enable git push via https for artifactSetVersion 2019-07-12 13:42:16 +02:00
Marcus Holl
d2c3248428 Enable http(s) push for artifactSetVersion 2019-07-12 13:42:16 +02:00
Andre Pany
0e990446fc whitesourceExecuteScan: Add scanType dub 2019-07-11 06:17:30 +02:00
Oliver Nocon
225cf2485b
Docker Pipeline - fixes and small adoptions (#779)
* buildExecute: Docker case - minor fixes
* properly care for empty `containerBuildOptions`
* verbose output wrt stashing
* add stage ordinals
* fix wrong script reference
* fix null reference
* adapt stage defaults and allow bats tests
* propagate github org and repo
* add test for bats
2019-07-05 16:32:24 +02:00
Sven Merk
3fa3b39ab6 Use GStringTemplateEngine instead of SimpleTemplateEngine
* avoid the use of SimpleTemplateEngine in areas that underly CPS transformation since it uses a non serializable java.io.StringWriter
2019-07-03 14:24:28 +02:00
andre2007
44f745d327 Rename dlang to dub (#762) 2019-07-03 11:27:07 +02:00
Oliver Nocon
9e539e68ee
Piper pipeline - enhance stages (#755)
* fill PRVoting stage with content
* add prVoting stage incl. tests
* add Build stage incl. Tests
* add docs pages
* add additional unit test stage
* add acceptance stage and additional documentation ...
* add release stage content
* add promote stage
* add Security stage, fix defaults for Promote stage
* fix issue in doc generation
2019-07-03 10:13:26 +02:00
Oliver Nocon
5bb6d59753
Add step buildExecute (#527)
This step should serve as generic entry point in pipelines for building artifacts.

Build principle: build once.

Purpose of the step:
- build using a defined build technology
- store build result for future use in testing etc.
2019-07-02 13:00:36 +02:00
Christopher Fenner
52ad001917 Update piperStageWrapper.groovy (#767) 2019-06-27 10:53:46 +02:00
Oliver Nocon
3e46254701
dockerExecuteOnKubernetes - hide sensitive information (#733)
* dockerExecuteOnKubernetes - hide yaml by default
* hide step parameters to not leak sensitive parameter values into the log
* add more details to log output
2019-06-26 08:38:47 +02:00
Marcus Holl
ea5a3ed5ce Merge remote-tracking branch 'github/master' into HEAD 2019-06-25 08:49:30 +02:00
Christopher Fenner
93e1796455
karmaExecuteTests: fix multi module execution (#765)
* add test case for multi module execution

* fix multi module issue
2019-06-24 15:29:32 +02:00
andre2007
36c029b344 Add dubExecute step (#754)
* Add dubExecute step
* Fix test
2019-06-19 16:52:18 +02:00
Oliver Nocon
d66607c31a
dockerExecuteOnKubernetes - support nodeSelector (#747)
support nodeSelector to run on dedicated nodes inside the Kubernetes cluster if required.
2019-06-19 12:26:16 +02:00
Christopher Fenner
68c657b2c1
Update handlePipelineStepErrors.groovy (#743) 2019-06-17 12:23:36 +02:00
Thorsten Duda
ff684ea692 added comment to explain escaped variable 2019-06-13 15:33:18 +02:00
Thorsten Duda
1c904b9f11 Fix PATH substitution 2019-06-13 13:33:03 +02:00
Oliver Nocon
e7cbf02b8e
dockerExecuteOnKubernetes - revert #739 (#745)
stashing .git directory had negative side-effects.
Solution would be to stash `.git` folder and unstash in `dockerExecuteOnKubernetes` only if required for a dedicated scenario.
2019-06-06 17:22:25 +02:00
Oliver Nocon
8455761fe9
Merge branch 'master' into nevskrem-patch-1 2019-06-05 11:25:03 +02:00
Oliver Nocon
121b23fdaa
dockerExecuteOnKubernetes - stash also .git folder (#739)
Make sure that complete workspace is available in Kubernetes Pod.
So far e.g. git repository information were missing.
2019-06-05 11:24:32 +02:00
Sven Merk
0f12bc8000
Add missing compatibility for productVersion 2019-06-04 12:00:22 +02:00
Sven Merk
111080cbfe Add new step for Dockerfile linting (#723)
* Add new step for Dockerfile linting

* Add documentation template file

* Remove newlines

* Remove internal URL

* Rephrase comment

* Ammend stash

* Fix test

* move dockerImage to general

* use explicit curl options

* small changes

* small changes

* skip GIT blame

* First comments

* Also add remark to URL parameter

* Second set of comments

* Fix return code handling

* Switch type to set

* Revert unrelated changes

* Avoid modification of config

* add quality gate defaults

* Update hadolintExecute.groovy

* fix code climate issue
2019-06-04 08:01:43 +02:00
Marcus Holl
45a2bfc4f7 shift coding for preparing defaultValueCache into that class
rather than having it in a pipeline step.

With that we avoid going back from a class in the src folder into
a pipeline step (vars).
2019-05-31 14:26:25 +02:00
Oliver Nocon
f171f88b13
whiteSourceExecuteScan - allow passing projects via cpe (#734) 2019-05-29 13:22:16 +02:00
Marcus Holl
6a551884e0 Merge remote-tracking branch 'github/master' into HEAD 2019-05-27 09:14:28 +02:00
Marcus Holl
56b651dbe9 Merge remote-tracking branch 'github/master' into HEAD 2019-05-24 14:26:07 +02:00
Marcus Holl
c053dbca17 Add test null provided via signatur for extensions (also inside collection) 2019-05-24 13:55:29 +02:00
Marcus Holl
952c6bbe88 remove empty line 2019-05-24 09:22:16 +02:00
Alejandra Ferreiro Vidal
927f199660 minor change in slackSendNotification documentation 2019-05-23 20:16:02 +02:00
Alejandra Ferreiro Vidal
c21a4a6a3e remove semikolons 2019-05-23 14:28:32 +02:00
Marcus Holl
7899f17b68 [nameing] improve misleading variable name. 2019-05-23 10:19:49 +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
14765d5b56
Merge branch 'master' into pr/avoidHavingNeoLogFolderStringLiteralThreeTimes 2019-05-22 10:59:18 +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
c59cb912dd docu: mtaExtensionDescriptors are only valid for deploy mode mta. 2019-05-22 08:24:14 +02:00
Tom Kiemes
e17753f3cd Fix formatting (#719)
* Fix formatting

Co-authored-by: Markus Winkler 

* Update createDocu.groovy
2019-05-22 08:16:07 +02:00
Christopher Fenner
77e344d181
fix code climate issues II (#715)
* fix code climate issues

* fix code climate issues

* fix code climate issues
2019-05-17 13:20:13 +02:00
Christopher Fenner
6d5fdd41bf
fix code climate issues (#712)
* fix code climate issues

* fix code climate issues

* Update GitUtils.groovy
2019-05-16 10:46:13 +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
Sven Merk
23439e3df3
Merge branch 'master' into fortify-PR 2019-05-15 20:56:19 +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
Sven Merk
07f73dab71 Compatibility to Piper PR support 2019-05-14 16:30:13 +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
Marcus Holl
48c96a5a31 Avoid having the same string literal for the neo log folder three times 2019-05-10 13:47:14 +02:00
Marcus Holl
cdc9e2c266 Merge remote-tracking branch 'github/master' into HEAD 2019-05-10 08:44:51 +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
46367263b6 Merge remote-tracking branch 'github/master' into HEAD 2019-05-09 15:49:26 +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
Oliver Nocon
46a6525c4e
Pipeline resilience - be more verbose (#677)
* Pipeline resilience - be more verbose

Be more verbose about when a pipeline gets into 'UNSTABLE' state.

Collect step name centrally to be able to inform end-users at a later point inside a pipeline (e.g. during an approval step).

* address PR feedback
2019-05-03 14:06:49 +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
Oliver Nocon
99821afab8
Doc - Add missing possible values (#679) 2019-04-29 11:43:26 +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
0a4deaf69a pipelineStashFiles: generate docu 2019-04-12 22:45:31 +02:00
Alejandra Ferreiro Vidal
0df4df8d58 neoDeploy: generate docu 2019-04-12 21:35:27 +02:00
Alejandra Ferreiro Vidal
89f37ed1a0 influxWriteData: generate docu 2019-04-12 20:29:09 +02:00
Alejandra Ferreiro Vidal
5448385985 add multicloud deploy step 2019-04-12 17:51:38 +02:00
Marcus Holl
bb03cb02e5 Merge remote-tracking branch 'github/master' into HEAD 2019-04-12 14:46:08 +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
Alejandra Ferreiro Vidal
f9db4245e9 cloudFoundryDeploy: generate docu 2019-04-12 13:08:05 +02:00
Oliver Nocon
4b02143ba3
Merge branch 'master' into pr/noCachedWorkspaceStashes 2019-04-12 11:59:31 +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
Alejandra Ferreiro Vidal
c7998f4db4 artifactSetVersion: generate docu 2019-04-12 09:23:10 +02:00
Christopher Fenner
dccaa780fc
cloudFoundryDeploy: return proper error message on deploy error (#651)
* return proper error message on deploy error

* fix typo

* provide meaningful error messages

* Update cloudFoundryDeploy.groovy

* Update cloudFoundryDeploy.groovy

* Update neoDeploy.groovy

* Update neoDeploy.groovy
2019-04-12 09:07:53 +02:00
Alejandra Ferreiro Vidal
0303d9baab githubPublishRelease: generate docu 2019-04-11 14:23:06 +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
Marcus Holl
76901afb00 Merge remote-tracking branch 'github/master' into HEAD 2019-04-11 07:56:35 +02:00
Alejandra Ferreiro Vidal
19f9005dc5 transportRequestRelease: generate docu 2019-04-10 15:27:06 +02:00
Alejandra Ferreiro Vidal
4c62102fa8 transportRequestUploadFile: generate docu 2019-04-10 13:58:46 +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
0565b5e63f transportRequestCreate: generate docu 2019-04-09 22:12:21 +02:00
Alejandra Ferreiro Vidal
394f94c851 update documentation 2019-04-09 20:46:45 +02:00
Alejandra Ferreiro Vidal
a179dc6e3d checksPublishResults: generate docu 2019-04-09 19:46:23 +02:00
Alejandra Ferreiro Vidal
86978becfc remove utils.getMandatoryParameter() 2019-04-09 16:25:25 +02:00
Alejandra Ferreiro Vidal
ea71736939 testsPublishResults: generate docu 2019-04-09 15:19:33 +02:00
Alejandra Ferreiro Vidal
2af1b7c365 setupCommonPipelineEnvironment: generate docu 2019-04-09 13:58:35 +02:00
Alejandra Ferreiro Vidal
938d251a58 pipelineRestartSteps: generate docu 2019-04-09 13:18:51 +02:00
Alejandra Ferreiro Vidal
7a54118b2a gaugeExecuteTests: generate docu 2019-04-09 11:59:08 +02:00
Alejandra Ferreiro Vidal
bde8f388be containerExecuteStructureTests: generate docu 2019-04-09 11:12:38 +02:00
Alejandra Ferreiro Vidal
fa05b0bcb6 prepareDefaultValues: generate docu (#634) 2019-04-09 09:52:45 +02:00
Alejandra Ferreiro Vidal
998dd99cf5 batsExecuteTests: generate docu (#605) 2019-04-09 08:39:20 +02:00
Oliver Nocon
35ced01ffa
Avoid unwanted behavior when using resilience options (#650)
Certain steps should always fail, even though resilience option `failOnError=false` is used.

* Docker execution typically happens in another step. We should not hide errors here but rather handle their resilience in the step which uses `dockerExecute` and `dockerExecuteOnKubernetes`.
* Wrapper steps like `pipelineExecute`, `pipelineRestartSteps` should not hide errors. If an error occured this has to be considered as **intentional** and not hidden accidentially in case resilience option is switched on.
2019-04-08 20:10:54 +02:00
Marcus Holl
a92c01b640 Merge remote-tracking branch 'github/master' into HEAD 2019-04-05 11:19:24 +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
Marcus Holl
4a756e1f4b Merge remote-tracking branch 'github/master' into HEAD 2019-04-05 10:08:49 +02:00
Sven Merk
2ad3483233
Merge branch 'master' into whitesource-step 2019-04-04 22:19:16 +02:00
Alejandra Ferreiro Vidal
1e36df6a9c fix docs generation (#640) 2019-04-04 17:01:30 +02:00
Sven Merk
259619f00f
Merge branch 'master' into whitesource-step 2019-04-04 16:06:51 +02:00
Sven Merk
097ee4179b Chris' final comments + Scala config 2019-04-04 16:05:26 +02:00
Marcus Holl
bc253d0036 Merge remote-tracking branch 'github/master' into HEAD 2019-04-04 15:54:52 +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
dfa47ac4c7
Merge branch 'master' into whitesource-step 2019-04-03 22:18:39 +02:00
Alejandra Ferreiro Vidal
316ea83423 fix doc build error 2019-04-03 15:44:59 +02:00
Marcus Holl
a011c67d09 No update to the stash content list from dockerExecuteOnK8S
When dealing with stashes in dockerExecuteOnKubernetes the global
stash list was updated from the step. This resulted in stashes
transported between the steps, which in turn resulted in having
old stashes unstashed in a pod later down the build. E.g.: mtaBuild
followed by neoDeploy: mtaBuild created a stash, the stash was
rememebered in the default stash list and re-used later on by
neoDeploy. Since the stash was created before the mtaBuild the
deployable was missing in the step.
2019-04-03 13:38:43 +02:00
Sven Merk
8fc6eb5219 Fix time displayed in report 2019-04-03 12:31:40 +02:00
Sven Merk
1fe05b8a56
Merge branch 'master' into whitesource-step 2019-04-03 12:19:34 +02:00
Alejandra Ferreiro Vidal
83ee7d0b28 mtaBuild: generate docu 2019-04-03 10:36:56 +02:00
Alejandra Ferreiro Vidal
92e895d34e pipelineExecute: generate docu 2019-04-03 09:41:27 +02:00
Alejandra Ferreiro Vidal
d863bb3209 durationMeasure: generate config 2019-04-03 08:16:33 +02:00
Alejandra Ferreiro Vidal
3d0aa51380 mavenExecute: generate docu 2019-04-02 22:03:23 +02:00
Alejandra Ferreiro Vidal
0397f152dc
Merge branch 'master' into healthExecuteCheck 2019-04-02 21:01:29 +02:00
Christopher Fenner
d2a615fbc3
Update vars/healthExecuteCheck.groovy
Co-Authored-By: alejandraferreirovidal <alejandra.ferreiro.vidal@sap.com>
2019-04-02 21:01:09 +02:00
Alejandra Ferreiro Vidal
f77d9957a5 handlePipelineStepErrors: generate docu 2019-04-02 20:06:47 +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
Marcus Holl
dea2dbcbaa neoDeploy: assert deployable exists before starting deployment.
Up to now the presence of the deployable (source) was checked late
by the NeoCommandLineHelper. The code doing this is surrounded by
the try/catch which finally also puts the log written by the neo
toolset into the job log in case an exception occured.

The check for the deployable returns with the same type of
exception like a failed neo command. Hence we cannot distiguish (ok,
would be possible to parse the exception message, but that is ugly).
When the exception is triggered by the missing deployable we try to
cat the neo log into the job log. But at this point the neo log has
not been provided - neo has not been called at all in this case.
Hence `cat logs/neo/*` in turn fails.

In order to avoid such a failure we check now for the presence of the
deployable earlier before launching the neo toolset.

Since the deployable is used in any deploy mode case no further check
for the deploy mode is required prior to the check for the deployable.
2019-04-02 13:53:31 +02:00
Oliver Nocon
24563db155
update stashing behavior (#628)
* update stashing behavior

close #619

* add test
2019-04-02 13:13:25 +02:00
Alejandra Ferreiro Vidal
4f93f1f07a healthExecuteCheck: generate docu 2019-04-01 11:14:38 +02:00
Marcus Holl
2b1b743082 provide the log in case of a failure always, not only in docker context
from property dockerImage we cannot conclude that we are in fact running inside a docker environment.
Step dockerExecute has some checks if we are in a docker context. If not there is a fallback to the
local environment.

The docker image property is provided from resources/default_pipeline_environment (value: 's4sdk/docker-neo-cli').
Hence a value will be present all the time (exception: someone configured null/ empty string explicitly). So we
will enter the corresponding code block anyway.

It is IMO also desirable to have the neo log in the job log when running inside a non-docker setup since this
simplifies troubleshooting anyway.
2019-03-29 16:31:09 +01:00
Sven Merk
aaf969e0cf
Merge branch 'master' into whitesource-step 2019-03-29 11:01:15 +01:00
Alejandra Ferreiro Vidal
6b98d642da removes toolValidate 2019-03-29 08:44:36 +01:00
Sven Merk
4ed0f8df36 Trigger build 2019-03-27 23:46:43 +01:00