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

Parameters now generated during build

This commit is contained in:
Marcus Holl 2018-12-17 11:52:12 +01:00
parent d9c536e25a
commit 1ef91ce8a3

View File

@ -17,30 +17,22 @@ is set to `false`, no `hudson.AbortException` will be thrown. In this case there
## Parameters ## Parameters
| parameter | mandatory | default | possible values | Content here is generated from corresponnding step, see `vars`.
| -------------------|-----------|--------------------------------------------------------|--------------------|
| `script` | yes | | |
| `changeDocumentId` | yes | | |
| `changeManagement/changeDocumentLabel` | no | `ChangeDocument\s?:` | regex pattern |
| `changeManagement/credentialsId` | yes | | |
| `changeManagement/endpoint` | yes | | |
| `changeManagement/git/from` | no | `origin/master` | |
| `changeManagement/git/to` | no | `HEAD` | |
| `changeManagement/git/format` | no | `%b` | see `git log --help` |
| `failIfStatusIsNotInDevelopment` | no | `true` | `true`, `false` |
* `script` - The common script environment of the Jenkinsfile running. Typically the reference to the script calling the pipeline step is provided with the `this` parameter, as in `script: this`. This allows the function to access the [`commonPipelineEnvironment`](commonPipelineEnvironment.md) for retrieving, for example, configuration parameters.
* `changeDocumentId` - The id of the change document to transport. If not provided, it is retrieved from the git commit history.
* `changeManagement/changeDocumentLabel` - A pattern used for identifying lines holding the change document id.
* `changeManagement/credentialsId` - The id of the credentials to connect to the Solution Manager. The credentials needs to be maintained on Jenkins.
* `changeManagement/endpoint` - The address of the Solution Manager.
* `changeManagement/git/from` - The starting point for retrieving the change document id
* `changeManagement/git/to` - The end point for retrieving the change document id
* `changeManagement/git/format` - Specifies what part of the commit is scanned. By default the body of the commit message is scanned.
* `failIfStatusIsNotInDevelopment` - when set to `false` the step will not fail in case the step is not in status 'in development'.
## Step configuration ## Step configuration
Content here is generated from corresponnding step, see `vars`.
## Exceptions
* `AbortException`:
* If the change id is not provided via parameter and if the change document id cannot be retrieved from the commit history.
* If the change is not in status `in development`. In this case no exception will be thrown when `failIfStatusIsNotInDevelopment` is set to `false`.
* `IllegalArgumentException`:
* If a mandatory property is not provided.
## Examples
The step is configured using a customer configuration file provided as The step is configured using a customer configuration file provided as
resource in an custom shared library. resource in an custom shared library.
@ -87,17 +79,7 @@ The properties can also be configured on a per-step basis:
failIfStatusIsNotInDevelopment: true failIfStatusIsNotInDevelopment: true
``` ```
The parameters can also be provided when the step is invoked. For examples see below. The parameters can also be provided when the step is invoked:
## Exceptions
* `AbortException`:
* If the change id is not provided via parameter and if the change document id cannot be retrieved from the commit history.
* If the change is not in status `in development`. In this case no exception will be thrown when `failIfStatusIsNotInDevelopment` is set to `false`.
* `IllegalArgumentException`:
* If a mandatory property is not provided.
## Examples
```groovy ```groovy
// simple case. All mandatory parameters provided via // simple case. All mandatory parameters provided via