This repository has been archived by the owner on Dec 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathJenkinsfile
103 lines (102 loc) · 2.41 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
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
pipeline {
agent any
environment{
MAYA_2018_DIR = 'C:/Maya-Devkit'
}
stages {
stage('Install'){
steps{
echo "Running ${env.BUILD_ID} on ${env.JENKINS_URL}"
bat '''cd "%WORKSPACE%\\Scripts"
call JenkinsWebhook.bat ":bulb: Building: %JOB_NAME%. Jenkins build nr: %BUILD_NUMBER%"
cd "%WORKSPACE%
install -remote "%WORKSPACE%"
if errorlevel 1 (
cd "%WORKSPACE%\\Scripts"
JenkinsWebhook ":x: %JOB_NAME% Build Failed!! Jenskins build nr: %BUILD_NUMBER% - install failed"
EXIT 1
)'''
}
}
stage('Build'){
steps{
bat'''
cd "%WORKSPACE%"
cmake --build ./build_vs2017_win64
if errorlevel 1 (
cd "%WORKSPACE%\\Scripts"
JenkinsWebhook ":x: %JOB_NAME% Build Failed!! Jenskins build nr: %BUILD_NUMBER% - 64bit-debug build failed"
EXIT 1
)
'''
bat'''
cd "%WORKSPACE%"
cmake --build ./build_vs2017_win64 --config Release
if errorlevel 1 (
cd "%WORKSPACE%\\Scripts"
JenkinsWebhook ":x: %JOB_NAME% Build Failed!! Jenskins build nr: %BUILD_NUMBER% - 64bit-release build failed"
EXIT 1
)
'''
}
}
stage('Test'){
steps{
script{
def has_failed = false
try{
bat'''
cd "%WORKSPACE%"
cd build_vs2017_win64/bin/debug
MayaUnitTest.exe
if errorlevel 1 (
EXIT 1
)
'''
}
catch( exc ){
has_failed = true
bat'''
cd "%WORKSPACE%\\Scripts"
JenkinsWebhook ":rage: %JOB_NAME% build nr: %BUILD_NUMBER% - 64bit-debug Tests failed"
'''
}
try{
bat'''
cd "%WORKSPACE%"
cd build_vs2017_win64/bin/release
MayaUnitTest.exe
if errorlevel 1 (
EXIT 1
)
'''
}
catch( exc ){
has_failed = true
bat'''
cd "%WORKSPACE%\\Scripts"
JenkinsWebhook ":rage: %JOB_NAME% build nr: %BUILD_NUMBER% - 64bit-release Tests failed"
'''
}
if(has_failed){
bat'''
cd "%WORKSPACE%\\Scripts"
JenkinsWebhook ":x: %JOB_NAME% Build Failed!! Jenskins build nr: %BUILD_NUMBER% - Tests Failed"
EXIT 1
'''
}
}
}
}
stage('Finalize'){
steps{
bat '''
rem mkdir builds
rem move ./RayTracingLib/Debug "./builds/build_%BUILD_NUMBER%"
cd "%WORKSPACE%\\scripts
call "JenkinsWebhook.bat" ":white_check_mark: %JOB_NAME% Build Succesfull!! Jenkins build nr: %BUILD_NUMBER%"
'''
}
}
}
}