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