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
83 lines (61 sloc)
1.76 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" ])

32
if(env.BRANCH_NAME == "master"){
33
tag = "latest"
34
}else{
35
tag = env.BRANCH_NAME
36
}
37

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

53
stage 'Tests'

55
sh 'bin/test.sh'

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

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

79

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