Skip to content

Commit

Permalink
Lots of new stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Van Fleet committed May 3, 2017
1 parent f81e4dc commit 6e8bd99
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/edu/internet2/jenkins/DockerBuild.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,25 @@ package edu.internet2;

class DockerBuild {
def steps
DockerBuild(steps){ this.steps = steps }
def env
DockerBuild(env){ this.env = env }

def tag() {
'latest'
}

def imagename() {
readCommonBash('imagename')
}

def maintainer() {
readCommonBash('maintainer')
}

def readCommonBash(String key = 'maintainer') {
def matcher = readFile('common.bash') =~ (key + '="(.+)"')
matcher ? matcher[0][1] : 'null'
}

def build(args){

Expand Down
8 changes: 8 additions & 0 deletions vars/buildDocker.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import edu.internet2.jenkins.DockerBuild

def call(env){
build = new DockerBuild(env)
echo build.maintainer()
echo build.imagename()
echo build.tag()
}
3 changes: 3 additions & 0 deletions vars/imagename.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def call() {
readCommonBash('imagename')
}
4 changes: 4 additions & 0 deletions vars/tag.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
def call(env){
echo env
env.BRANCH_NAME
}

0 comments on commit 6e8bd99

Please sign in to comment.