Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use scripts from /bin within pipeline.
Chris Bynum committed Aug 4, 2016
1 parent 853c056 commit 4e07c7d
Showing 1 changed file with 31 additions and 10 deletions.
41 changes: 31 additions & 10 deletions 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.