Permalink
Aug 19, 2016
Aug 19, 2016
Aug 19, 2016
Aug 19, 2016
Aug 22, 2016
Aug 19, 2016
Sep 2, 2016
Sep 5, 2016
Sep 5, 2016
Aug 22, 2016
Aug 31, 2016
Aug 22, 2016
Aug 22, 2016
Sep 2, 2016
Sep 5, 2016
Sep 5, 2016
Aug 22, 2016
Aug 19, 2016
Aug 19, 2016
Aug 19, 2016
Aug 31, 2016
Aug 22, 2016
Aug 19, 2016
Newer
100644
130 lines (91 sloc)
3.74 KB

1
#!groovy

3

5

7

8
if (BRANCH_TEST=="shibboleth-production"){
9
node('packer') {
10
currentBuild.result = "SUCCESS"

11

14
sh 'rm -rf output-shibboleth-*'
15
sh 'rm -rf "/Users/levvel/VirtualBox VMs/shibboleth-appliance-*"'

19
withCredentials([[$class: 'FileBinding', credentialsId: 'tier-aws-config', variable: 'FILE']]) {

26
withCredentials([[$class: 'FileBinding', credentialsId: 'tier-aws-credentials', variable: 'FILE']]) {

36
37
stage 'Acquire ansible-playbooks'
38
39
sh 'mkdir -p ansible-playbooks'
40
dir('ansible-playbooks'){
41
git([ url: "https://github.internet2.edu/docker/ansible-playbooks.git",
42
branch: "shibboleth-production", credentialsId: "jenkins-github-access-token" ])
43
}
44
45
stage 'Validate'
46
47
sh '/usr/local/bin/packer validate shibboleth-appliance.json'
48
49
stage 'Build Appliance - Shibboleth'
50
51
sh '/usr/local/bin/packer build shibboleth-appliance.json'
52

57
slackSend color: 'good', message: "BUILD SUCCESS: Shibboleth Appliance build success. ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL} |Open>)"
58

59
}
60
61
catch (err) {
62
currentBuild.result = "FAILURE"
63
64
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}"
65
66
throw err
67
}

69
} else if (BRANCH_TEST=="comanage-production"){
70
node('packer') {
71
currentBuild.result = "SUCCESS"
72
73
try {

75
sh 'rm -rf output-comanage-*'
76
sh 'rm -rf "/Users/levvel/VirtualBox VMs/comange-appliance-*"'

80
withCredentials([[$class: 'FileBinding', credentialsId: 'tier-aws-config', variable: 'FILE']]) {

87
withCredentials([[$class: 'FileBinding', credentialsId: 'tier-aws-credentials', variable: 'FILE']]) {

97
98
stage 'Acquire ansible-playbooks'
99
100
sh 'mkdir -p ansible-playbooks'
101
dir('ansible-playbooks'){
102
git([ url: "https://github.internet2.edu/docker/ansible-playbooks.git",
103
branch: "comanage-production", credentialsId: "jenkins-github-access-token" ])
104
}

105

107

109

118
slackSend color: 'good', message: "BUILD SUCCESS: Comanage Appliance build success. ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL} |Open>)"
119

120
}
121
122
catch (err) {
123
currentBuild.result = "FAILURE"
124
125
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}"
126
127
throw err
128
}
129
}

130
}