Permalink
Jul 27, 2016
Jul 27, 2016
Jul 27, 2016
Aug 2, 2016
Aug 9, 2016
Aug 3, 2016
Jul 27, 2016
Jul 27, 2016
Aug 8, 2016
Jul 27, 2016
Jul 27, 2016
Jul 27, 2016
Newer
100644
82 lines (60 sloc)
1.71 KB

3
stage 'Checkout'
4
5
checkout scm

7
stage 'Acquire util'

9
sh 'mkdir -p bin'
10
dir('bin'){
11
git([ url: "https://github.internet2.edu/docker/util.git",
12
credentialsId: "jenkins-github-access-token" ])
13
sh 'ls'
14
sh 'mv bin/* .'
15
}

17
stage 'Acquire conftree'
18
19
sh 'mkdir -p root'
20
dir('root'){
21
git([ url: "https://github.internet2.edu/docker/shib-idp-conftree.git",
22
branch: "test", credentialsId: "jenkins-github-access-token" ])

29
def tag
30
31
if(env.BRANCH_NAME == "master"){
32
tag = "latest"
33
}else{
34
tag = env.BRANCH_NAME
35
}
36

37
if(!imagename){
38
echo "You must define an imagename in common.bash"
39
currentBuild.result = 'FAILURE'
40
}
41
if(maintainer){
42
echo "Building ${maintainer}:${tag} for ${maintainer}"

52
stage 'Tests'

54
sh 'bin/test.sh'

60
stage 'Push'
61
62
docker.withRegistry('https://registry.hub.docker.com/', 'dockerhub-bigfleet') {
63
def baseImg = docker.build("$maintainer/$imagename")
64
baseImg.push("$tag")
65
}

66
67
}
68
69
def maintainer() {
70
def matcher = readFile('common.bash') =~ 'maintainer="(.+)"'
71
matcher ? matcher[0][1] : 'tier'
72
}
73
74
def imagename() {
75
def matcher = readFile('common.bash') =~ 'imagename="(.+)"'
76
matcher ? matcher[0][1] : null
77
}

78

79
def version() {
80
def matcher = readFile('common.bash') =~ 'version="(.+)"'
81
matcher ? matcher[0][1] : null