Permalink
Aug 19, 2016
Aug 19, 2016
Aug 19, 2016
Aug 19, 2016
Aug 22, 2016
Aug 19, 2016
Aug 22, 2016
Aug 31, 2016
Aug 22, 2016
Aug 22, 2016
Aug 22, 2016
Aug 19, 2016
Aug 19, 2016
Aug 19, 2016
Aug 31, 2016
Aug 22, 2016
Aug 19, 2016
Newer
100644
98 lines (65 sloc)
2.5 KB

1
#!groovy

3

5

7

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

11

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
stage 'Sync appliances to S3 bucket'
40
41
sh 'aws s3 sync /builds s3://internet2-appliance-us-west-1'
42

43
}
44
45
catch (err) {
46
currentBuild.result = "FAILURE"
47
48
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}"
49
50
throw err
51
}

53
} else if (BRANCH_TEST=="comanage-production"){
54
node('packer') {
55
currentBuild.result = "SUCCESS"
56
57
try {

67
68
stage 'Acquire ansible-playbooks'
69
70
sh 'mkdir -p ansible-playbooks'
71
dir('ansible-playbooks'){
72
git([ url: "https://github.internet2.edu/docker/ansible-playbooks.git",
73
branch: "comanage-production", credentialsId: "jenkins-github-access-token" ])
74
}

75

77

79

84
stage 'Sync appliances to S3 bucket'
85
86
sh 'aws s3 sync /builds s3://internet2-appliance-us-west-1'
87

88
}
89
90
catch (err) {
91
currentBuild.result = "FAILURE"
92
93
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}"
94
95
throw err
96
}
97
}

98
}