Skip to content
Permalink
ae6676e6de
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
79 lines (52 sloc) 2.14 KB
#!groovy
echo "My Branch is: ${env.BRANCH_NAME}"
BRANCH_TEST = "${env.BRANCH_NAME}"
if (BRANCH_TEST=="shibboleth-production"){
node('packer') {
currentBuild.result = "SUCCESS"
try {
stage 'Checkout'
checkout scm
stage 'Acquire ansible-playbooks'
sh 'mkdir -p ansible-playbooks'
dir('ansible-playbooks'){
git([ url: "https://github.internet2.edu/docker/ansible-playbooks.git",
branch: "shibboleth-production", credentialsId: "jenkins-github-access-token" ])
}
stage 'Validate'
sh '/usr/local/bin/packer validate shibboleth-appliance.json'
stage 'Build Appliance - Shibboleth'
sh '/usr/local/bin/packer build shibboleth-appliance.json'
}
catch (err) {
currentBuild.result = "FAILURE"
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}"
step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "$email-error-id", sendToIndividuals: true])
throw err
}
}
} else if (BRANCH_TEST=="comanage-production"){
node('packer') {
currentBuild.result = "SUCCESS"
try {
stage 'Checkout'
checkout scm
stage 'Acquire ansible-playbooks'
sh 'mkdir -p ansible-playbooks'
dir('ansible-playbooks'){
git([ url: "https://github.internet2.edu/docker/ansible-playbooks.git",
branch: "comanage-production", credentialsId: "jenkins-github-access-token" ])
}
stage 'Validate'
sh '/usr/local/bin/packer validate comange-appliance.json'
stage 'Build Appliance - Shibboleth'
sh '/usr/local/bin/packer build comanage-appliance.json'
}
catch (err) {
currentBuild.result = "FAILURE"
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}"
step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "$email-error-id", sendToIndividuals: true])
throw err
}
}
}