2017-07-11 15:12:03 +02:00
|
|
|
# commonPipelineEnvironment
|
|
|
|
|
|
|
|
## Description
|
2018-11-06 14:50:09 +02:00
|
|
|
|
2017-07-11 15:12:03 +02:00
|
|
|
Provides project specific settings.
|
|
|
|
|
|
|
|
## Prerequisites
|
2018-11-06 14:50:09 +02:00
|
|
|
|
2017-07-11 15:12:03 +02:00
|
|
|
none
|
|
|
|
|
|
|
|
## Method details
|
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
### getInfluxCustomData()
|
|
|
|
|
|
|
|
#### Description
|
2018-11-06 14:50:09 +02:00
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
Returns the Influx custom data which can be collected during pipeline run.
|
|
|
|
|
|
|
|
#### Parameters
|
2018-11-06 14:50:09 +02:00
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
none
|
|
|
|
|
|
|
|
#### Return value
|
2018-11-06 14:50:09 +02:00
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
A `Map` containing the data collected.
|
|
|
|
|
|
|
|
#### Side effects
|
2018-11-06 14:50:09 +02:00
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
none
|
|
|
|
|
|
|
|
#### Exceptions
|
2018-11-06 14:50:09 +02:00
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
none
|
|
|
|
|
|
|
|
#### Example
|
2018-11-06 14:50:09 +02:00
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
```groovy
|
|
|
|
def myInfluxData = commonPipelineEnvironment.getInfluxCustomData()
|
|
|
|
```
|
|
|
|
|
|
|
|
### getInfluxCustomDataMap()
|
|
|
|
|
|
|
|
#### Description
|
2018-11-06 14:50:09 +02:00
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
Returns the Influx custom data map which can be collected during pipeline run.
|
|
|
|
It is used for example by step [`influxWriteData`](../steps/influxWriteData.md).
|
|
|
|
The data map is a map of maps, like `[pipeline_data: [:], my_measurement: [:]]`
|
|
|
|
Each map inside the map represents a dedicated measurement in the InfluxDB.
|
|
|
|
|
|
|
|
#### Parameters
|
2018-11-06 14:50:09 +02:00
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
none
|
|
|
|
|
|
|
|
#### Return value
|
2018-11-06 14:50:09 +02:00
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
A `Map` containing a `Map`s with data collected.
|
|
|
|
|
|
|
|
#### Side effects
|
2018-11-06 14:50:09 +02:00
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
none
|
|
|
|
|
|
|
|
#### Exceptions
|
2018-11-06 14:50:09 +02:00
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
none
|
|
|
|
|
|
|
|
#### Example
|
2018-11-06 14:50:09 +02:00
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
```groovy
|
|
|
|
def myInfluxDataMap = commonPipelineEnvironment.getInfluxCustomDataMap()
|
|
|
|
```
|
2017-11-24 16:59:34 +02:00
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
### getPipelineMeasurement(measurementName)
|
|
|
|
|
|
|
|
#### Description
|
2018-11-06 14:50:09 +02:00
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
Returns the value of a specific pipeline measurement.
|
|
|
|
The measurements are collected with step [`durationMeasure`](../steps/durationMeasure.md)
|
|
|
|
|
|
|
|
#### Parameters
|
2018-11-06 14:50:09 +02:00
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
Name of the measurement
|
|
|
|
|
|
|
|
#### Return value
|
2018-11-06 14:50:09 +02:00
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
Value of the measurement
|
|
|
|
|
|
|
|
#### Side effects
|
2018-11-06 14:50:09 +02:00
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
none
|
|
|
|
|
|
|
|
#### Exceptions
|
2018-11-06 14:50:09 +02:00
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
none
|
|
|
|
|
|
|
|
#### Example
|
2018-11-06 14:50:09 +02:00
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
```groovy
|
|
|
|
def myMeasurementValue = commonPipelineEnvironment.getPipelineMeasurement('build_stage_duration')
|
|
|
|
```
|
|
|
|
|
|
|
|
### setPipelineMeasurement(measurementName, value)
|
|
|
|
|
|
|
|
#### Description
|
2018-11-06 14:50:09 +02:00
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
**This is an internal function!**
|
|
|
|
Sets the value of a specific pipeline measurement.
|
|
|
|
Please use the step [`durationMeasure`](../steps/durationMeasure.md) in a pipeline, instead.
|
|
|
|
|
|
|
|
#### Parameters
|
2018-11-06 14:50:09 +02:00
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
Name of the measurement and its value.
|
|
|
|
|
|
|
|
#### Return value
|
2018-11-06 14:50:09 +02:00
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
none
|
|
|
|
|
|
|
|
#### Side effects
|
2018-11-06 14:50:09 +02:00
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
none
|
|
|
|
|
|
|
|
#### Exceptions
|
2018-11-06 14:50:09 +02:00
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
none
|
|
|
|
|
|
|
|
#### Example
|
2018-11-06 14:50:09 +02:00
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
```groovy
|
|
|
|
commonPipelineEnvironment.setPipelineMeasurement('build_stage_duration', 2345)
|
|
|
|
```
|