Skip to content
Permalink
Newer
Older
100644 90 lines (61 sloc) 2.28 KB
Mason Packard
Aug 19, 2016
1
#!groovy
Mason Packard
Aug 24, 2016
2
// pipeline file for building appliances
Mason Packard
Aug 19, 2016
3
4
echo "My Branch is: ${env.BRANCH_NAME}"
Mason Packard
Aug 19, 2016
5
6
BRANCH_TEST = "${env.BRANCH_NAME}"
Mason Packard
Aug 19, 2016
7
8
if (BRANCH_TEST=="shibboleth-production"){
9
node('packer') {
10
currentBuild.result = "SUCCESS"
Mason Packard
Aug 19, 2016
11
13
stage 'Cleanup & Setup'
14
sh 'rm -rf output-*'
15
sh 'rm -rf "/Users/levvel/VirtualBox VMs/"'
Mason Packard
Aug 31, 2016
16
sh 'rm -rf builds'
17
sh 'mkdir -p builds'
21
checkout scm
22
23
stage 'Acquire ansible-playbooks'
24
25
sh 'mkdir -p ansible-playbooks'
26
dir('ansible-playbooks'){
27
git([ url: "https://github.internet2.edu/docker/ansible-playbooks.git",
28
branch: "shibboleth-production", credentialsId: "jenkins-github-access-token" ])
29
}
30
31
stage 'Validate'
32
33
sh '/usr/local/bin/packer validate shibboleth-appliance.json'
34
35
stage 'Build Appliance - Shibboleth'
36
37
sh '/usr/local/bin/packer build shibboleth-appliance.json'
38
39
}
40
41
catch (err) {
42
currentBuild.result = "FAILURE"
43
44
slackSend color: 'danger', message: "BUILD ERROR: There was a problem with Shibboleth Appliance. ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL} |Open>) \n\n ${err}"
45
46
throw err
47
}
48
}
49
} else if (BRANCH_TEST=="comanage-production"){
50
node('packer') {
51
currentBuild.result = "SUCCESS"
52
53
try {
54
stage 'Cleanup & Setup '
55
sh 'rm -rf output-*'
56
sh 'rm -rf "/Users/levvel/VirtualBox VMs"'
Mason Packard
Aug 31, 2016
57
sh 'rm -rf builds'
58
sh 'mkdir -p builds'
62
checkout scm
63
64
stage 'Acquire ansible-playbooks'
65
66
sh 'mkdir -p ansible-playbooks'
67
dir('ansible-playbooks'){
68
git([ url: "https://github.internet2.edu/docker/ansible-playbooks.git",
69
branch: "comanage-production", credentialsId: "jenkins-github-access-token" ])
70
}
Mason Packard
Aug 19, 2016
71
Mason Packard
Aug 19, 2016
73
74
sh '/usr/local/bin/packer validate comange-appliance.json'
Mason Packard
Aug 19, 2016
75
76
stage 'Build Appliance - Comanage'
Mason Packard
Aug 20, 2016
77
78
sh '/usr/local/bin/packer build comanage-appliance.json'
Mason Packard
Aug 20, 2016
79
80
}
81
82
catch (err) {
83
currentBuild.result = "FAILURE"
84
85
slackSend color: 'danger', message: "BUILD ERROR: There was a problem with Comanage Appliance. ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL} |Open>) \n\n ${err}"
86
87
throw err
88
}
89
}
Mason Packard
Aug 19, 2016
90
}
You can’t perform that action at this time.