1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00
Commit Graph

28 Commits

Author SHA1 Message Date
Daniel Kurzynski
3992f17b32
Fix injection of download cache parameters (#1605)
- NPMRegistry was always an empty string
- MTA did not use npm registry
2020-05-27 18:20:10 +02:00
Florian Wilhelm
eaf5479e9c
Fix maven parameter handling (#1493)
Avoid maven error `Unknown lifecycle phase \"-\"` when the value of a define contains `-`.

Don't split and trim maven arguments. Expect they come in as a list, keep them as list.

This is a breaking change compared to the old Groovy implementation which relied on using a shell for calling maven.

As an example, consider this diff:

```diff
-        goals: 'org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate',
-        defines: "-Dexpression=$pomPathExpression -DforceStdout -q",
+        goals: ['org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate'],
+        defines: ["-Dexpression=$pomPathExpression", "-DforceStdout", "-q"],
```
2020-05-06 17:43:32 +02:00
Daniel Kurzynski
974327d16e
Use mavenExecute from go (#1388)
Also establish mavenExecute() via new JenkinsMavenExecuteRule in Groovy Unit Tests.

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-04-24 10:41:49 +02:00
Florian Geckeler
b509e14afd
Use maven evaluate for mavenArtifactVersioning
* add evaluateFromMavenPom to piper Utils
* adapt mavenExecute to accept `returnStdout` as parameter. If configured mavenExecute will return the stdout for further processing
* adapt tests of mavenExecute and mavenArtifactVersioning as well as add another exception to CommonStepsTest because mavenExecute will return a String if configured
2020-01-23 09:31:01 +01:00
Florian Wilhelm
49c704c9aa
Allow setting global maven config in MTA builder (#667) 2019-04-24 12:47:37 +02:00
Alejandra Ferreiro Vidal
3d0aa51380 mavenExecute: generate docu 2019-04-02 22:03:23 +02:00
Christopher Fenner
10267ce7d1
Analytics: add step parameter keys (#442)
* add stepParamKey values

* camelCase
2019-01-21 08:47:34 +01:00
Marcus Holl
b7468a7ae4 Step name is not a string literal anymore
Having the step name always the same like the file name, which is in turn the class name is
redundant.
2018-11-29 09:54:05 +01:00
Marcus Holl
5d444aa4ba Fix codeclimate remarks 2018-11-05 12:33:41 +01:00
Marcus Holl
2e8a9db02c script = this as fallback instead of map with cpe of current step
o The map does not provide access to e.g. sh, echo.

o this has the same cpe as property as it is constructed with the
current map approach.
2018-10-31 12:52:45 +01:00
Marcus Holl
ea23d65594 Merge remote-tracking branch 'github/master' into HEAD 2018-10-30 17:01:19 +01:00
Marcus Holl
11d34c2157 Step called without script: webanalytics 2018-10-30 16:24:48 +01:00
Marcus Holl
c03a75da9f Ensure script is mandatory parameter
... only in case a step uses the script at all.
2018-10-30 16:24:47 +01:00
Marcus Holl
6653b68c0f Merge remote-tracking branch 'github/master' into HEAD 2018-10-18 12:54:32 +02:00
Marcus Holl
f47d540aa3 Introduce dedicated factory method for configuration helper 2018-10-17 11:15:37 +02:00
Christopher Fenner
01365295cb remove step return types 2018-10-11 09:10:26 +02:00
Marcus Holl
8db2aaf5f0 don't use load step defaults as implicit factory method. 2018-09-07 10:08:16 +02:00
Ramachandra Kamath Arbettu
c84114c3df
Enable support for executing on K8S as a step (#231)
* Create executeDockerOnKubernetes.groovy

* Update dockerExecute.groovy

* Create SysEnvTest.groovy

* Update default_pipeline_environment.yml

* Update executeDockerOnKubernetes.groovy

* Create utils object

* update docker image

* Update mavenExecute.groovy

* Use pipeline-lib than piper

* Check container name

* Always change ownership to 1000

* Check for map

* Fix command

* Move chmod to docker execute

* Use generic name for the pod

* runAsPod has been added

* Return false if script has no k8smapping

* fix syntax error

* Null checks

* Returnn dockerImage name

* Check method body

* Return container name

* Cleanup echos

* Use runAsPod

* Rename step

* Use official jenkins JNLP agent image

* Construct containersMap

* Check if kubernetes plugin is active

* Support JaaS

* pass script object

* Move configuration to default section

* Use generic flag to check if running in k8s

* fix jnlp agent name

* Solve travis errors

* Improvements to config and changes to name of the method

* Improvements to config

* Fix type

* Rename stash config

* add import

* Fix map order

* Fix jnlp agent name

* cleanup config usage

* Check if config is enabled

* Use nested k8s mapping

* Support custom docker workspace and move flag to env

* Feature/k8s stage (#1)

* Use nested k8s mapping

* Support custom docker workspace and move flag to env

* Check dockerOptions value

* Support local execution

* Add tests for dockerExecute

* Move config to step and Fix tests

* Use step configuration while running as a pod

* Streamline parameter and config initialization

* Streamline parameter and tests

* Cleanup and align variable name

* Use default JNLP agent if one not defined in config

* Add tests for runInsidePod. Ensure lowercase container names.

* Improve tests and remove unused code block

* Fix permission issues

* Perform stashing and unstashing inside container

* Use custom jnlp agent due to user id restriction

* Fix tests after jnlp agent change

* Address review comments

* Initialize script to default value if null

* Address review comments

* Update exeception handling and documentation

* Improve documentation

* correct indent

* Link documents to the index page

* Merge containerExecute and dockerExecuteOnKuberenetes step and address comments.

* Update dockerExecute.md

* Update dockerExecuteOnKubernetes.md

* Update default_pipeline_environment.yml

* update documentation

* Update documentation. Use annotation for singleton

* Update DockerExecuteOnKubernetesTest.groovy

* Update dockerExecute.groovy

* Update dockerExecuteOnKubernetes.groovy

* Improve documentation and test case names

* neoDeploy: switch to chained ConfigurationHelper (#244)

* switch neoDeploy to chained ConfigurationHelper

* update imports

* Improve tests

* Address review comments

* Improve documentation

* made dockerImage non-mandatory parm, improved test

* add comment regarding userid assumption
2018-08-21 15:45:59 +02:00
Christopher Fenner
6007f54074
use new config handler in steps (#253)
* use new config handler

* use new config handler

* add reporting

* Update checksPublishResults.groovy

* remove unused ConfigurationMerger methods

* fix typo

* revert changes on script loading

* remove outdated test case

* Add missing import
2018-08-15 11:53:28 +02:00
Florian Wilhelm
0a86c8534d
Improve check for batch mode in mavenExecute (#226)
The old naive check fails if an argument starts with '-B'. Now we use a
regular expression, which should correctly match if batch mode was
already supplied, and add it if not.
2018-07-26 16:03:05 +02:00
Florian Wilhelm
6dc13801b0
Disable download logs in Maven by default (#159)
Disable download logs in Maven by default

This commit adds a flag to Maven by default, which disables the messages
like "Downloading from central".

The logger is set to level "warn", so errors will still be visible, but
successful messages won't clutter logs anymore.

This option is also set by default in the GitLab CI template file for
maven.

See [1] for reference on the option.

1: https://stackoverflow.com/a/35653426/8843830
2018-06-06 14:42:47 +02:00
Alejandra Ferreiro Vidal
51b2241b2f
Merge pull request #100 from SAP/removeFetchUrl
remove fetchUrl Step
2018-05-24 14:39:18 +02:00
Daniel Kurzynski
fe4707faeb
Improve Docker options configuration and forward from mavenExecute (#123) 2018-03-29 14:13:11 +02:00
Alejandra Ferreiro Vidal
36788e2b45 remove null value from merge 2018-03-08 17:16:20 +01:00
Marcus Holl
efafd9a44a [refactoring] resolve data inside merge (#101) 2018-02-28 11:42:19 +01:00
Marcus Holl
5fe76eb9dc Replace usage of lists for denoting keys by sets.
The characteristics of a list are
  o the order of the entries is significant
  o duplicates are allowed

The characteristics of a set are
  o the order is not significant
  o duplicates are not allowed.

When describing keys for a step the characteristics of a
set applies here, whereas the characteristics of a list does
not apply.
2018-02-19 12:53:08 +01:00
Willenbacher
9663b33203 remove fetchUrl Step 2018-02-15 16:06:47 +01:00
Daniel Kurzynski
22ee06dc17 Enable configuration via yaml file + mavenExecute as example (#18)
* Enable configuration via yaml file
* Add documentation 
* Add tests
2017-12-06 12:03:06 +01:00