forked from DCMTK/dcmtk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
56 lines (50 loc) · 1.34 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
def buildTypes(String branch) {
return ['Release', 'Debug', 'RelWithDebInfo'];
}
pipeline {
options { buildDiscarder(logRotator(numToKeepStr: '3')) }
environment {
BASE_DIR = "/tmp"
BUILD_DIR = "/tmp/build"
ARTIFACT_FILE = "dcmtk.tar.bz2"
}
agent {
dockerfile {
filename 'Dockerfile.build'
label 'backend'
args '-v ${WORKSPACE}:/tmp'
}
}
parameters {
choice(
name: 'BUILD_TYPE',
choices: buildTypes(env.BRANCH_NAME),
description: 'Select type of build: Release, Debug, Release with Debug Info'
)
}
stages {
stage('Build') {
steps {
sh '''
echo "[Build] Branch: ${BRANCH_NAME}"
cc --version
c++ --version
ls -l ${BASE_DIR}
cd ${BUILD_DIR}
cmake \
-DCMAKE_BUILD_TYPE="Release" \
-DDCMTK_ENABLE_PRIVATE_TAGS="ON" \
-DDCMTK_ENABLE_STL="ON" \
..
make -j16
tar cjf ${ARTIFACT_FILE} -C ${BUILD_DIR}/bin .
'''
}
}
}
post {
success {
archiveArtifacts artifacts: "build/${ARTIFACT_FILE}"
}
}
}