1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-03-05 15:15:44 +02:00

Merge pull request #635 from alejandraferreirovidal/setupCommonPipelineEnvironment

setupCommonPipelineEnvironment: generate docu
This commit is contained in:
Alejandra Ferreiro Vidal 2019-04-09 15:04:46 +02:00 committed by GitHub
commit 083b38cac4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 22 deletions

View File

@ -1,30 +1,14 @@
# setupCommonPipelineEnvironment
# ${docGenStepName}
## Description
Initializes the [`commonPipelineEnvironment`](commonPipelineEnvironment.md), which is used throughout the complete pipeline.
!!! tip
This step needs to run at the beginning of a pipeline right after the SCM checkout.
Then subsequent pipeline steps consume the information from `commonPipelineEnvironment`; it does not need to be passed to pipeline steps explicitly.
## ${docGenDescription}
## Prerequisites
* A **configuration file** with properties (default location: `.pipeline/config.properties`). The property values are used as default values in many pipeline steps.
* A **configuration file** with properties. The property values are used as default values in many pipeline steps.
## Parameters
## ${docGenParameters}
| parameter | mandatory | default | possible values |
| ------------ |-----------|-------------------------------|-----------------|
| `script` | yes | - | |
| `configFile` | no | `.pipeline/config.properties` | |
* `script` - The reference to the pipeline script (Jenkinsfile). Normally `this` needs to be provided.
* `configFile` - Property file defining project specific settings.
## Step configuration
none
## ${docGenConfiguration}
## Side effects

View File

@ -1,12 +1,32 @@
import static com.sap.piper.Prerequisites.checkScript
import com.sap.piper.GenerateDocumentation
import com.sap.piper.ConfigurationHelper
import com.sap.piper.Utils
import groovy.transform.Field
@Field String STEP_NAME = getClass().getName()
@Field Set GENERAL_CONFIG_KEYS = ['collectTelemetryData']
@Field Set GENERAL_CONFIG_KEYS = [
/** */
'collectTelemetryData'
]
@Field Set STEP_CONFIG_KEYS = []
@Field Set PARAMETER_KEYS = [
/** Property file defining project specific settings.*/
'configFile'
]
/**
* Initializes the [`commonPipelineEnvironment`](commonPipelineEnvironment.md), which is used throughout the complete pipeline.
*
* !!! tip
* This step needs to run at the beginning of a pipeline right after the SCM checkout.
* Then subsequent pipeline steps consume the information from `commonPipelineEnvironment`; it does not need to be passed to pipeline steps explicitly.
*/
@GenerateDocumentation
void call(Map parameters = [:]) {
handlePipelineStepErrors (stepName: STEP_NAME, stepParameters: parameters) {