Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Moving to properties file reading
Jim Van Fleet committed May 4, 2017
1 parent 91697b0 commit 02dc8f7
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 4 additions & 5 deletions 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){
9 changes: 8 additions & 1 deletion 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()

0 comments on commit 02dc8f7

Please sign in to comment.