Set the default Docker Label for Pipeline

Now that there is more than one kind of agent available, we need to explicitly
state where a Docker workload should run.

Fixes #33
This commit is contained in:
R. Tyler Croy 2017-08-25 09:25:09 -07:00
parent b38166e12b
commit 59ca4cc5ef
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
1 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,14 @@
#!/usr/bin/env groovy
/*
* This file is responsible for setting Global Pipeline configurations to the
* sensible defaults which are necessary
*/
import jenkins.model.GlobalConfiguration
import org.jenkinsci.plugins.pipeline.modeldefinition.config.GlobalConfig
/* Set the default Docker label for Declarative Pipeline to .. wait for it .. docker */
GlobalConfig c = GlobalConfiguration.all().find { it instanceof GlobalConfig }
c?.dockerLabel = 'docker'