-
Notifications
You must be signed in to change notification settings - Fork 0
/
JenkinsfileVS2015
127 lines (96 loc) · 4.12 KB
/
JenkinsfileVS2015
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
pipeline {
agent {label 'w16bld-cimnet01'}
environment {
VS_ROOT = 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0'
BOOST_ROOT = 'D:\\boost_1_63_0'
XERCES_ROOT = 'D:\\xerces-c-3.1.3'
CMAKE_ROOT = 'C:\\Program Files (x86)\\CMake'
SOURCE_ROOT = 'D:\\JBld\\workspace\\CIMNet\\Build_Main\\vs2015\\NMM_DEV\\src'
NMM_ROOT = 'D:\\opt\\nmm_Windows_x64_vc140'
M2_ROOT = 'C:\\opt\\apache-maven-3.2.5'
NODEJS_ROOT = 'D:\\nodejs'
WIX_ROOT = 'C:\\Program Files (x86)\\WiX Toolset v3.11'
VERSION = VersionNumber([projectStartDate: '', versionNumberString: '${BUILD_YEAR}${BUILD_MONTH, XX}${BUILD_DAY, XX}_${BUILDS_TODAY, XX}', versionPrefix: ''])
}
options {
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '5'))
}
stages {
stage ("Fetch") {
steps {
script {
def versionNumber = "${VERSION}"
currentBuild.displayName = versionNumber
}
// clear source dir
deleteDir()
// Get source code from the fetch project
step ([$class: 'CopyArtifact',
projectName: 'Fetch',
filter: 'nmm_dev.zip']);
// unzip source in workspace
bat """
@ECHO ON
if not exist NMM_DEV mkdir NMM_DEV
move nmm_dev.zip NMM_DEV
cd NMM_DEV
unzip -o -qq nmm_*.zip
rm -f nmm_*.zip
attrib -r /s . > nul
chmod -R ugo+rw . > nul
ls
"""
}
}
stage ('CMAKE') {
steps {
// build solutions and generate code
bat "${SOURCE_ROOT}/../buildScripts/cmake.bat"
}
}
stage ('C++ Build') {
steps {
// C++ build and unit tests
bat "${SOURCE_ROOT}/../buildScripts/cppBuild.bat"
}
}
stage ('Java Build') {
steps {
// Maven build and ui packageing
bat "${SOURCE_ROOT}/../buildScripts/javaBuild.bat"
// temporary fix for possible orphaned cimnet process after running integration tests
bat """
tasklist /fi "imagename eq cimnet_network_commands.exe" |find ":" > nul
if errorlevel 1 taskkill /f /im "cimnet_network_commands.exe"
"""
}
}
stage ('Package') {
steps {
// Build the kit and msi
bat "${SOURCE_ROOT}/../buildScripts/package.bat"
}
}
}
post {
always {
step([$class: 'XUnitBuilder',
thresholds: [[$class: 'FailedThreshold', unstableThreshold: '1']],
tools: [[$class: 'JUnitType', pattern: '**/surefire-reports/*.xml'],
[$class: 'JUnitType', pattern: '**/generatedJUnitFiles/JUnit/*.xml'],
[$class: 'BoostTestJunitHudsonTestType', pattern: '**/*_results.xml'],
]])
}
unstable {
emailext(body: '${JELLY_SCRIPT,template="ci_build_html"}',
subject: 'CIMNet Build Unstable',
}
failure {
emailext(body: '${JELLY_SCRIPT,template="ci_build_html"}',
subject: 'CIMNet Build Failure',
}
}
}