diff --git a/src/edu/internet2/jenkins/DockerBuild.groovy b/src/edu/internet2/jenkins/DockerBuild.groovy index 34cddd5..9d5856b 100644 --- a/src/edu/internet2/jenkins/DockerBuild.groovy +++ b/src/edu/internet2/jenkins/DockerBuild.groovy @@ -3,11 +3,11 @@ package edu.internet2.jenkins; class DockerBuild implements Serializable { def script def env - def config - DockerBuild(script, env, config){ + def properties + DockerBuild(script, env, properties){ this.script = script this.env = env - this.config = config + this.properties = properties } def envDebug() { @@ -38,8 +38,7 @@ class DockerBuild implements Serializable { } def readCommonBash(String key = 'maintainer') { - def matcher = config =~ (key + '="(.+)"') - matcher ? matcher[0][1] : null + properties.get(key) } def build(args){ diff --git a/vars/buildDocker.groovy b/vars/buildDocker.groovy index e414c4f..3f3dd15 100644 --- a/vars/buildDocker.groovy +++ b/vars/buildDocker.groovy @@ -1,7 +1,14 @@ import edu.internet2.jenkins.DockerBuild def call(env){ - build = new DockerBuild(this, env, readFile('common.bash')) + + def content = readFile 'common.bash' + + Properties properties = new Properties + InputStream is = new ByteArrayInputStream(content.getBytes()); + properties.load(is) + + build = new DockerBuild(this, env, properties) echo build.maintainer() echo build.imagename() echo build.tag()