-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile_linux
More file actions
96 lines (88 loc) · 2.76 KB
/
Jenkinsfile_linux
File metadata and controls
96 lines (88 loc) · 2.76 KB
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
#!groovy
pipeline {
// agent defines where the pipeline will run.
agent {
label "sl7cloud"
}
triggers {
pollSCM('H/2 * * * *')
}
// The options directive is for configuration that applies to the whole job.
options {
buildDiscarder(logRotator(numToKeepStr:'10'))
timeout(time: 60, unit: 'MINUTES')
disableConcurrentBuilds()
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 = sh(returnStdout: true, script: 'git rev-parse HEAD').trim()
env.GIT_BRANCH = sh(returnStdout: true, script: 'git rev-parse --abbrev-ref HEAD').trim()
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"
env.IS_E4 = "YES"
}
else if (env.GIT_BRANCH == "origin/master_E3_maint") {
env.IS_RELEASE = "NO"
env.IS_DEPLOY = "YES"
env.IS_E4 = "NO"
}
else if (env.GIT_BRANCH == "origin/master") {
env.IS_RELEASE = "NO"
env.IS_DEPLOY = "YES"
env.IS_E4 = "YES"
}
else {
env.IS_RELEASE = "NO"
env.IS_DEPLOY = "NO"
env.IS_E4 = "YES"
}
}
sh """
cd build
export GIT_COMMIT=${env.GIT_COMMIT}
export GIT_BRANCH=${env.BRANCH_NAME}
export RELEASE=${env.IS_RELEASE}
export DEPLOY=${env.IS_DEPLOY}
sh jenkins_build.sh
"""
}
}
}
}
def archiveCheckstyleResults() {
step([$class: "CheckStylePublisher",
canComputeNew: false,
defaultEncoding: "",
healthy: "",
pattern: "**/target/checkstyle-result.xml",
unHealthy: "",
usePreviousBuildAsReference: true])
}