Skip to content
Permalink
Newer
Older
100644 42 lines (34 sloc) 1.04 KB
1
node {
2
stage 'Checkout'
3
4
checkout scm
5
6
stage 'BUILD: Base'
7
8
try{
9
// Build Base Image
10
dir('bin') {
11
sh './build.sh &> debug'
12
}
13
// Build Base Image
14
// sh './build_image.sh &> debug'
15
// Run Base Container
16
// sh 'bin/run.sh'
17
} catch(error) {
18
def error_details = readFile('./bin/debug');
19
def message = "BUILD ERROR: There was a problem building the Base Image. \n\n ${error_details}"
20
sh "rm -f ./bin/debug"
21
handleError(message)
22
}
23
24
stage 'TEST: Base'
25
26
sh '/usr/local/bin/bats tests/base.bats'
27
28
stage 'SHIP: Base'
29
30
docker.withRegistry('https://registry.hub.docker.com/', 'dockerhub-bigfleet') {
31
def baseImg = docker.build('bigfleet/centos7base')
32
baseImg.push('latest')
33
}
36
def handleError(String message){
37
echo "${message}"
38
currentBuild.setResult("FAILED")
39
slackSend color: 'danger', message: "${message}"
40
step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'chris.bynum@levvel.io', sendToIndividuals: true])
41
sh 'exit 1'
42
}
You can’t perform that action at this time.