-
Notifications
You must be signed in to change notification settings - Fork 0
/
scriptgeneratorJenkinsfile
111 lines (99 loc) · 2.81 KB
/
scriptgeneratorJenkinsfile
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
#!groovy
pipeline {
// agent defines where the pipeline will run.
agent {
label "ndw1757"
}
triggers {
pollSCM('H/2 * * * *')
}
// The options directive is for configuration that applies to the whole job.
options {
buildDiscarder(logRotator(numToKeepStr:'10'))
timeout(time: 120, unit: 'MINUTES')
disableConcurrentBuilds()
timestamps()
skipDefaultCheckout(true)
office365ConnectorWebhooks([[
name: "Office 365",
notifyBackToNormal: true,
startNotification: false,
notifyFailure: true,
notifySuccess: false,
notifyNotBuilt: false,
notifyAborted: false,
notifyRepeatedFailure: true,
notifyUnstable: true,
url: "${env.MSTEAMS_URL}"
]]
)
}
stages {
stage("Checkout") {
steps {
echo "Branch: ${env.BRANCH_NAME}"
checkout scm
}
}
stage("Build") {
steps {
script {
// env.BRANCH_NAME is only supplied to multi-branch pipeline jobs
if (env.BRANCH_NAME == null) {
env.BRANCH_NAME = ""
}
env.GIT_COMMIT = bat(returnStdout: true, script: '@git rev-parse HEAD').trim()
env.GIT_BRANCH = scm.branches[0].name
echo "git commit: ${env.GIT_COMMIT}"
echo "git branch: ${env.BRANCH_NAME} ${env.GIT_BRANCH}"
if (env.BRANCH_NAME.startsWith("Release")) {
env.IS_RELEASE = "YES"
env.IS_DEPLOY = "NO"
}
else if (env.GIT_BRANCH == "refs/heads/master") {
env.IS_RELEASE = "NO"
env.IS_DEPLOY = "YES"
}
else {
env.IS_RELEASE = "NO"
env.IS_DEPLOY = "NO"
}
}
bat """
cd build
set GIT_COMMIT=${env.GIT_COMMIT}
set GIT_BRANCH=${env.BRANCH_NAME}
set RELEASE=${env.IS_RELEASE}
set DEPLOY=${env.IS_DEPLOY}
jenkins_build_script_generator.bat
"""
}
}
stage("Checkstyle") {
steps {
archiveCheckstyleResults()
}
}
stage("Doxygen") {
steps {
bat '''
"C:\\Program Files\\doxygen\\bin\\doxygen.exe" build\\ibex_gui_doxy.config
'''
}
}
}
post {
always {
junit '**/surefire-reports/TEST-*.xml'
}
}
}
def archiveCheckstyleResults() {
step([$class: "CheckStylePublisher",
canComputeNew: false,
defaultEncoding: "",
healthy: "",
pattern: "**/target/checkstyle-result.xml",
unHealthy: "",
usePreviousBuildAsReference: true])
}