Skip to content
Permalink
Browse files

Use scripts from /bin within pipeline.

  • Loading branch information
Chris Bynum
Chris Bynum committed Aug 4, 2016
1 parent 853c056 commit 4e07c7deaf3850cb8d679419acb5c5019d092c88
Showing with 31 additions and 10 deletions.
  1. +31 −10 Jenkinsfile
@@ -3,19 +3,40 @@ node {

checkout scm

stage 'Base'

sh './build_image.sh'

stage 'Tests'

stage 'BUILD: Base'

try{
// Build Base Image
dir('bin') {
sh './build.sh &> debug'
}
// Build Base Image
// sh './build_image.sh &> debug'
// Run Base Container
// sh 'bin/run.sh'
} catch(error) {
def error_details = readFile('./bin/debug');
def message = "BUILD ERROR: There was a problem building the Base Image. \n\n ${error_details}"
sh "rm -f ./bin/debug"
handleError(message)
}

stage 'TEST: Base'

sh '/usr/local/bin/bats tests/base.bats'
stage 'Push'

stage 'SHIP: Base'

docker.withRegistry('https://registry.hub.docker.com/', 'dockerhub-bigfleet') {
def baseImg = docker.build('bigfleet/centos7base')
baseImg.push('latest')
}
}

}
def handleError(String message){
echo "${message}"
currentBuild.setResult("FAILED")
slackSend color: 'danger', message: "${message}"
step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'chris.bynum@levvel.io', sendToIndividuals: true])
sh 'exit 1'
}

0 comments on commit 4e07c7d

Please sign in to comment.
You can’t perform that action at this time.