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

Annotate docker plugin check as non cps (#134)

This commit is contained in:
Daniel Kurzynski 2018-04-20 12:59:17 +02:00 committed by Oliver Nocon
parent 48b816e028
commit 3d5a97ab71

View File

@ -13,7 +13,7 @@ def call(Map parameters = [:], body) {
if(dockerImage) {
if (! Jenkins.instance.pluginManager.plugins.find { p -> p.isActive() && p.getShortName() == PLUGIN_ID_DOCKER_WORKFLOW } ) {
if (! isPluginActive(PLUGIN_ID_DOCKER_WORKFLOW) ) {
echo "[WARNING][${STEP_NAME}] Docker not supported. Plugin '${PLUGIN_ID_DOCKER_WORKFLOW}' is not installed or not active. Configured docker image '${dockerImage}' will not be used."
dockerImage = null
}
@ -44,6 +44,11 @@ def call(Map parameters = [:], body) {
}
}
@NonCPS
private isPluginActive(String pluginId){
return Jenkins.instance.pluginManager.plugins.find { p -> p.isActive() && p.getShortName() == pluginId }
}
/**
* Returns a string with docker options containing
* environment variables (if set).