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

361 Commits

Author SHA1 Message Date
Marcus Holl
8afec9b4dc Merge remote-tracking branch 'github/master' into HEAD 2018-09-12 11:14:03 +02:00
Sven Merk
61de848114
Merge branch 'master' into pr/removeMockHelper 2018-09-10 14:03:07 +02:00
Marcus Holl
aedfb13a6b Merge remote-tracking branch 'github/master' into HEAD 2018-09-10 13:52:22 +02:00
Marcus Holl
9e378d6b46 Remove obsolete code: mockHelper
in fact the MockHelper seems not to be used anymore. Apparently fully
superseded by our JenkinsRules.
2018-09-10 13:44:42 +02:00
Marcus Holl
c0c0adbeda Prune useless code from MTABuild test. (#288)
should have been removed earlier with the other pull request removing writing the test files.
This is pure leftover.
2018-09-10 13:28:11 +02:00
Marcus Holl
68ab5bacd6 mock GitUtils
if we don't mock the GitUtils here changes inside GitUtils affecting the git commands
issued at the command line requires changes here. In fact we have to react on
implementation details of the GitUtils here. It is better to be independent from that
implementation details here since this leads to more focused and smaller commits.
2018-09-07 16:14:00 +02:00
Marcus Holl
cce1eb0f9a Execute closures when evaluating shell calls
This allows us to e.g. also throw exceptions (e.g. hudson.AbortException) when dealing with
mocked shell calls.
2018-09-07 15:27:55 +02:00
Christopher Fenner
7b49858233
Merge branch 'master' into pr/artifactSetVersionStreamlineGitHandling 2018-09-05 11:46:11 +02:00
Marcus Holl
12d8f48c38 Do only what is really needed inside the body of sshAgent
- there is no need to do the git commit inside the body of sshAgent
- there is no need to do the git tag inside the body of sshAgent

- side catch: availablility of git user name and git user email is
  checked at its own. If one is missing the other may be present
  ~somehow~ in the configuration.
2018-09-04 17:04:07 +02:00
Florian Wilhelm
50ac5b0ac9
Execute MTA builder in Docker 2018-09-04 11:32:54 +02:00
Marcus Holl
cb3860ffe9 remove not needed closure when registering yaml file 2018-09-04 10:50:03 +02:00
Marcus Holl
138a41f02a Merge remote-tracking branch 'github/master' into work 2018-09-04 10:42:36 +02:00
Marcus Holl
6b7dc48c44 Be more flexible with JenkinsReadYaml rule
When we register a closure as file, the closure will be exectutd.
Otherwise we return what is registered.

This gives us a maximum level of flexibility. We can throw exceptions (e.g. FileNotFound) as
as test setup requires this, in simple cases we provide the yaml as a string.
2018-09-04 09:46:59 +02:00
Marcus Holl
fb425a4c70 Register empty pipeline config yml by default 2018-09-03 15:43:17 +02:00
Marcus Holl
94241f1a6c Register yaml content at beginning of test 2018-09-03 15:43:17 +02:00
Marcus Holl
26ecbe5013 Provide option for registering file for read yaml.
We can now registering files to JenkinsReadYamlRule by
providing the file name alongside with the expected content
(or e.g. an expception)

With that change it is possible to remove pwd statements
from mtaBuild. These statements was used in order to pass
a temporary directory inside the mtaBuild (code under test).
This is not needed anymore since we can register the files
directly.

Having pwd implies working with absolute pathes which is
also a no-go when working with docker, since the absolute
pathes inside and outside docker are normally not the same.

For pathes relative to a build root directory it is rather
easy to keep the pathes consistent the same.

Adjust sources according to registering yaml file to jenkins rule.

For mtaBuild this means also: get ride of absolute pathes for denoting the yaml file.
Having absolute pathes makes it difficult/impossible to work also with dockerized versions
of mtaBuild since the absolute pathes are most probably not the same inside and outside
the docker container, but the relatives pathes can be kept the same easily.
2018-09-03 15:43:15 +02:00
Marcus Holl
f2feb8f5ad Ensure consistent location for files used by versioning tests (#278) 2018-08-31 14:13:11 +02:00
Marcus Holl
8a019f5b86 Remove read yaml rule from common rules
read yaml rule is a very frequently used rule. But having the rule in the common rules
means we cannot register text or files to that rule, which makes it less handy to work
with yaml files in the tests.
2018-08-31 10:22:46 +02:00
Christopher Fenner
4425629ee7
notify about deactivated SWA reporting (#261)
* report deactivated SWA reporting

* Update Utils.groovy

* add tests

* add test cases

* use hamcrest matchers in tests

* check for missing call to web analytics

* Update UtilsTest.groovy
2018-08-29 10:01:16 +02:00
Roland Stengel
67429626a7 cmclient call needs to quote the file path 2018-08-28 15:29:08 +02:00
Marcus Holl
edee92020c No versionBackup files for mvn versioning (#259) 2018-08-22 09:59:19 +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
Marcus Holl
044e940dec No need for manipulating origin url
the gitSshUrl can be provided directly to the push call. This avoids footprint on the build
servers git repository.
2018-08-21 13:39:48 +02:00
Marcus Holl
6c6f106f26 Avoid several sh calls for consecutive git calls. 2018-08-21 13:39:48 +02:00
Marcus Holl
3a72d16185 neoDeploy with archvive from CPE 2018-08-17 15:46:46 +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
Oliver Nocon
17ee927807
batsExecuteTests - add step for executing bats-core (#254)
details are available in the documentation contained in this PR
2018-08-15 11:41:01 +02:00
Christopher Fenner
8e40a4cf62
Merge branch 'master' into pr/trUploadFileApplicationIdFromConfiguration 2018-08-15 09:59:25 +02:00
Marcus Holl
45f4952c71 Read applicationId also from configuration 2018-08-15 09:48:59 +02:00
Marcus Holl
bfb131407d Merge remote-tracking branch 'github/master' into HEAD 2018-08-14 12:13:30 +02:00
Christopher Fenner
c538e896f3
Merge branch 'master' into CCFenner/newman 2018-08-09 14:25:22 +02:00
Oliver Nocon
71f7f05427
add telemetry reporting to steps (#243)
add telemetry to all steps using ConfigurationHelper.
Other steps need to be switched to ConfigurationHelper first.

update docs
2018-08-09 11:35:33 +02:00
Thorsten Willenbacher
9dfc7fcd01 refactor withCredentials to ChangeManagement util class
fix tests to match refactoring
2018-08-09 11:03:30 +02:00
Christopher Fenner
059268459a
Merge branch 'master' into CCFenner/newman 2018-08-09 10:34:00 +02:00
Oliver Nocon
65b582dc9d
artifactSetVersion - add new artifact types & cleanup (#242)
* artifactSetVersion - add new artifact types & cleanup

added:
* dlang
* golang
* npm
* pip
* scala

* add documentation update
2018-08-08 22:21:26 +02:00
Christopher Fenner
240df88882
add stashing & private test repositories 2018-08-08 11:22:08 +02:00
Marcus Holl
3d78affc3b
Merge branch 'master' into pr/transportRequestUploadFilewithMtarFileFromCPE 2018-08-03 08:49:05 +02:00
Christopher Fenner
2c2700f10a
Merge branch 'master' into CCFenner-patch-2 2018-08-01 08:54:45 +02:00
Christopher Fenner
30f0c5a6cc
correct test cases 2018-08-01 08:50:21 +02:00
Christopher Fenner
0db93df011
fix closure 2018-08-01 08:41:49 +02:00
Christopher Fenner
8c7dc44d1d
add tests 2018-08-01 08:30:10 +02:00
Marcus Holl
0bac7ac27e Take mtarFilePath in commonPipelineEnviroment into account
This allows the steps to interact without using return values (which is not possible in
declarative pipelines). On the other hand we have depencencies between the steps based
on the status of the commonPipelineEnvironment.
2018-07-31 16:55:15 +02:00
Marcus Holl
f2e0e81802
Merge branch 'master' into fix/rolebackNeoDeployChange 2018-07-31 16:41:36 +02:00
Oliver Nocon
d844b23b90
add cloudFoundryDeploy step (#173)
* add cloudFoundryDeploy step
* added cf-cli docker image
* support existing parameters
* support check script with flexible STATUS_CODE
* add mandatory parameters
* fix compatibility handling
* address PR feedback
* fix access to smokeTest script
* make credentialsId mandatory to avoid NPE
2018-07-30 09:28:24 +02:00
Marcus Holl
d49a9ad68c Revert "remove the tool descriptor from neo deploy"
This reverts commit c3c7d8b142.
2018-07-27 14:09:08 +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
rodibrin
9e547cd605
Merge branch 'master' into pr/neoimage 2018-07-26 10:04:20 +02:00
Roland Stengel
c3c7d8b142 remove the tool descriptor from neo deploy 2018-07-25 15:23:56 +02:00
Marcus Holl
f16d5c766b Merge remote-tracking branch 'github/master' into HEAD 2018-07-25 12:26:20 +02:00
Christopher Fenner
aa57127e84
Merge branch 'master' into pr/readNestedProperties 2018-07-25 09:49:33 +02:00