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

62 Commits

Author SHA1 Message Date
Oliver Feldmann
741b49140e
Move pull image parameters to general section (#2478)
* Move pull image parameters to general section

* Allow no nesting override

* Test dockerPullImage can be set to true

As the default is false, we need to make sure it can still be set to true.
2021-01-13 10:48:48 +01:00
Stephan Aßmus
c74500545c
dockerExecute: Add compatibility aliasing for renamed params (#2391) 2020-11-17 17:44:19 +01:00
Stephan Aßmus
cbd932a5eb
dockerExecute: Wrap all code in docker.withRegistry() (#2384)
* wrap all in docker.withRegistry()

* Renamed parameter

No backwards alias, since it never worked before.

* Fix code and tests

* Rename parameter as per review

* Rename parameter as per review

Co-authored-by: Daniel Kurzynski <daniel.kurzynski@sap.com>
2020-11-17 14:53:09 +01:00
Marcus Holl
b2b4278b34
Provide Additional pod properties for dockerExecuteOnKubernetes (#2051)
Provide additional pod properties for dockerExecuteOnKubernetes

Co-authored-by: Kay Wegner <kay.wegner@sap.com>
2020-10-02 12:56:16 +02:00
Marcus Holl
bed3ec1e28
[refactoring] Avoid having simiar dockerExecuteOnKubernetes call twice. (#2067)
Having that like this increases maintainability.
2020-09-30 13:44:40 +02:00
Christopher Fenner
b219fb6514
fix(typo): found by misspell (#2064)
* fix typos in step yamls

* fix typos in go files

* regenerate step code

* fix typos in md files

* fix typos in groovy files

* fix further typos
2020-09-24 07:41:06 +02:00
Marcus Holl
c092ab0c28
support credentials for docker pull (#1990)
support credentials for docker pull

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
Co-authored-by: Florian Wilhelm <florian.wilhelm02@sap.com>
2020-09-23 11:50:57 +02:00
Stephan Aßmus
8169d56ef7
Groovy: Load step defaults also from stages section in defaults (#1943)
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-08-26 15:32:58 +02:00
Stephan Aßmus
a61798ccbf
New step mavenExecuteIntegration (#1829)
Co-authored-by: Florian Wilhelm <florian.wilhelm02@sap.com>
2020-07-29 19:51:27 +02:00
Stephan Aßmus
56699ab019
Run artifactPrepareVersion in maven container if necessary (#1634)
* The metadata for artifactPrepareVersion-go specifies a container for when the buildTool is maven.
* The alias to 'mavenExecute' was removed. The problem with this is that when a section containers is included in the metadata, dockerImage will always be picked up from mavenExecute, the conditional dependency on buildTool will not even be considered. Parameters such as m2Path, projectSettingsFile and globalSettingsFile should be configured in general/maven if necessary.
* When the step ends up being executed within dockerExecuteOnKubernetes, we need to preserve the .git folder. This folder would normally be excluded by the default excludes of the stash step. There was already a comment that suppressing this behavior by passing useDefaultExcludes: false was problematic (unfortunately without going into details), so I've added a new parameter to dockerExecute and dockerExecuteOnKubernetes named stashNoDefaultExcludes (note the reverted meaning to ease preserving the default behavior when this parameter is not provided). This parameter is passed to piperExecuteBin from the artifactPreferVersion groovy wrapper.
2020-06-08 17:08:05 +02:00
Daniel Kurzynski
6bd259e5d4
Fix sidecar env vars (#1292) 2020-03-20 11:36:16 +01:00
Sven Merk
c645087517
NotSerializableException next part (#1262)
* Update dockerExecute.groovy

* Update dockerExecute.groovy

* Update dockerExecute.groovy
2020-03-11 10:05:03 +01:00
Christopher Fenner
a79fd95fd8
fix: correct jenkinsKubernetes parameter exposure & docs (#721)
* remove jenkinsKubernetes parameter
2020-02-04 08:02:38 +01:00
Christoph Szymanski
9d7d801788
Improve documentation for mtaJarLocation and dockerImage config (#856) 2019-11-17 22:08:47 +01:00
Florian Geckeler
565ac99742 Handle sidecar parameters in dockerExecuteOnKubernetes (#869) 2019-09-12 10:52:05 +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
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
weloli
519a5d6384 web analytics: add reporting for dockerExecute and dockerExecuteOnKubernetes (#516)
web analytics: add reporting for dockerExecute and dockerExecuteOnKubernetes
2019-03-26 17:06:34 +01:00
Daniel Kurzynski
9f4a597778
Wait for sidecar container to be ready (#567) 2019-03-18 14:05:42 +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
Christopher Fenner
bd32367c31
dockerExecute: generate docs (#480)
* correct key order

* add docs annotation and description

* describe parameters

* remove generated content from doc

* fix indent

* add further decumentations
2019-02-04 14:35:44 +01:00
Marcus Holl
b7deda1964 dockerExecute: make javadoc comment to 'normal' comment (#481)
since it is not intendend to expose the method docu as api doc.
2019-02-04 10:53:20 +01:00
Christopher Fenner
ba2e83c76a
dockerExecuteOnKubernetes: correct parameter keys (#475)
* Update dockerExecuteOnKubernetes.groovy

* Update dockerExecute.groovy

* Update dockerExecuteOnKubernetes.groovy
2019-02-04 09:03:58 +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
c8c96f11e3 Escape blanks when contained in env values for docker 2019-01-18 15:48:58 +01:00
Marcus Holl
dd8e09c527 Streamline flow control
in order to avoid to have to escape at two locations in the code.
2019-01-18 15:48:58 +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
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
3cb958b740 Merge remote-tracking branch 'github/master' into HEAD 2018-11-05 13:30:43 +01:00
Christopher Fenner
aa5ad1c0d1 dockerExecute: handle stashContent (#332)
* handle stashed content
* add utils
2018-11-05 11:24:25 +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
c03a75da9f Ensure script is mandatory parameter
... only in case a step uses the script at all.
2018-10-30 16:24:47 +01:00
Christopher Fenner
48990bac47
dockerExecute: use docker network to connect sidecar containers (#352)
* use docker network to connect containers

* add container names

* use network-alias instead of name

* Update dockerExecute.groovy

* Update dockerExecute.groovy

* Update dockerExecute.groovy

* Update dockerExecute.groovy

* Update DockerExecuteTest.groovy

* remove obsolete parameter

* Update default_pipeline_environment.yml

* Update DockerExecuteTest.groovy

* Update dockerExecute.groovy

* Update DockerExecuteTest.groovy

* Update dockerExecute.groovy

* update docs
2018-10-24 10:13:28 +02:00
Marcus Holl
d4f9171247 erge remote-tracking branch 'github/master' into HEAD 2018-10-18 11:02:09 +02:00
Marcus Holl
f47d540aa3 Introduce dedicated factory method for configuration helper 2018-10-17 11:15:37 +02:00
Oliver Nocon
7a961ef38e
seleniumExecuteTests - add step to run Selenium tests (#318)
It comes with an extension to executeDocker and executeDockerOnKubernetes to run sidecar containers.

This helps to execute Selenium tests using two Docker images:

1. Execution runtime for tests (e.g. node image)
2. Selenium instance which holds Selenium server + browser

* add documentation & some name cleanup
* include PR feedback
* add step documentation to structure
2018-10-04 17:06:42 +02:00
Marcus Holl
8db2aaf5f0 don't use load step defaults as implicit factory method. 2018-09-07 10:08:16 +02:00
Marcus Holl
b7e19da716 align step stage mixin order among pipeline steps 2018-08-29 10:31:01 +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
Daniel Kurzynski
322a437763 Revert "Merge branch 'master' of https://github.com/SAP/jenkins-library"
This reverts commit 65220efb4e, reversing
changes made to cf17510641.
2018-06-08 11:55:38 +02:00
Ramachandra Kamath Arbettu
d78dc454fb Support K8S execution 2018-06-07 13:58:32 +02:00
Ramachandra Kamath Arbettu
e3787f4450
Update dockerExecute.groovy 2018-06-07 13:04:53 +02:00
Ramachandra Kamath Arbettu
e612cd1fa2
Update dockerExecute.groovy 2018-06-07 12:08:28 +02:00
Ramachandra Kamath Arbettu
259cc9bfeb
Update dockerExecute.groovy 2018-06-07 12:07:16 +02:00
Ramachandra Kamath Arbettu
9b2ec38412
Update dockerExecute.groovy 2018-05-31 15:57:41 +02:00
Ramachandra Kamath Arbettu
d30bfa3dd9
Update dockerExecute.groovy 2018-05-31 15:49:23 +02:00
Ramachandra Kamath Arbettu
793e0991c7 POC K8S 2018-05-15 14:47:59 +02:00
Ramachandra Kamath Arbettu
3b17287b8e POC K8S 2018-05-15 09:08:09 +02:00