forked from apache/nifi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
81 lines (74 loc) · 1.89 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
node ('DataIntegration')
{
timestamps { timeout(time: 7200000, unit: 'MILLISECONDS')
{
stage 'Checkout'
env.PATH = "${userprofile}"+"\\Downloads\\apache-maven-3.5.0-bin\\apache-maven-3.5.0\\bin;${env.PATH}"
env.JAVA_HOME = "${ProgramFiles}"+"\\Java\\"+env.JDK_VERSION
try
{
checkout scm
}
catch(Exception e)
{
currentBuild.result = 'FAILURE'
}
if(currentBuild.result != 'FAILURE')
{
stage 'Build Source'
try
{
gitlabCommitStatus("Build")
{
bat 'powershell.exe -ExecutionPolicy ByPass -File build/build.ps1 -Script '+env.WORKSPACE+"/build/build.cake -Target build -NugetServerUrl "+env.nugetserverurl
}
def files = findFiles(glob: '**/cireports/errorlogs/*.txt')
if(files.size() > 0)
{
currentBuild.result = 'FAILURE'
}
}
catch(Exception e)
{
currentBuild.result = 'FAILURE'
}
}
if(currentBuild.result != 'FAILURE')
{
stage 'Code violation'
try
{
gitlabCommitStatus("Code violation")
{
bat 'powershell.exe -ExecutionPolicy ByPass -File build/build.ps1 -Script '+env.WORKSPACE+"/build/build.cake -Target codeviolation"
}
}
catch(Exception e)
{
currentBuild.result = 'FAILURE'
}
}
if(currentBuild.result != 'FAILURE')
{
stage 'Test'
try
{
gitlabCommitStatus("Test")
{
bat 'powershell.exe -ExecutionPolicy ByPass -File build/build.ps1 -Script '+env.WORKSPACE+"/build/build.cake -Target test"
}
}
catch(Exception e)
{
currentBuild.result = 'FAILURE'
}
}
stage 'Delete Workspace'
// Archiving artifacts when the folder was not empty
def files = findFiles(glob: '**/cireports/**/*.*')
if(files.size() > 0)
{
archiveArtifacts artifacts: 'cireports/', excludes: null
}
step([$class: 'WsCleanup']) }
}}