-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathJenkinsfile
74 lines (74 loc) · 2.48 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
pipeline {
agent any
environment {
MSG_PREFIX = "${env.JOB_NAME} - ${env.BUILD_DISPLAY_NAME}"
MSG_LINK = "(<${env.BUILD_URL}|Open>)"
DOCKER_BUILD_OPTION="--force-rm --no-cache --pull"
REG=credentials('gwangmin-dockerhub')
}
stages {
stage('pre-build') {
steps {
slackSend(message: "${MSG_PREFIX} started ${MSG_LINK}", failOnError: true, color: 'good')
}
}
stage('base') {
failFast true
parallel {
stage ("base:latest") {
steps {
sh '''
sudo docker login -u ${REG_USR} -p ${REG_PSW}
sudo docker build -t gwangmin/base:latest -f dockerfiles/base --build-arg BASEIMG=centos7_dev --build-arg CFLAGS="-march=core2 -mtune=core-avx2 -O2" ${DOCKER_BUILD_OPTION} .
sudo docker push gwangmin/base:latest
'''
}
}
stage ("base:gcc5") {
steps {
sh '''
sudo docker login -u ${REG_USR} -p ${REG_PSW}
sudo docker build -t gwangmin/base:gcc5 -f dockerfiles/base --build-arg BASEIMG=centos7_gcc5 ${DOCKER_BUILD_OPTION} .
sudo docker push gwangmin/base:gcc5
'''
}
}
stage ("base:gcc7") {
steps {
sh '''
sudo docker login -u ${REG_USR} -p ${REG_PSW}
sudo docker build -t gwangmin/base:gcc7 -f dockerfiles/base --build-arg BASEIMG=centos7_gcc7 ${DOCKER_BUILD_OPTION} .
sudo docker push gwangmin/base:gcc7
'''
}
}
stage ("base:gcc8") {
steps {
sh '''
sudo docker login -u ${REG_USR} -p ${REG_PSW}
sudo docker build -t gwangmin/base:gcc8 -f dockerfiles/base --build-arg BASEIMG=centos7_gcc8 ${DOCKER_BUILD_OPTION} .
sudo docker push gwangmin/base:gcc8
'''
}
}
stage ("base:clang") {
steps {
sh '''
sudo docker login -u ${REG_USR} -p ${REG_PSW}
sudo docker build -t gwangmin/base:clang -f dockerfiles/base --build-arg BASEIMG=centos7_clang ${DOCKER_BUILD_OPTION} .
sudo docker push gwangmin/base:clang
'''
}
}
}
}
}
post {
success {
slackSend(message: "${MSG_PREFIX} finished ${MSG_LINK}", failOnError: true, color: 'good')
}
failure {
slackSend(message: "${MSG_PREFIX} failed ${MSG_LINK}", failOnError: true, color: 'danger')
}
}
}