-
Notifications
You must be signed in to change notification settings - Fork 460
Expand file tree
/
Copy pathJenkinsfile
More file actions
40 lines (39 loc) · 1.53 KB
/
Jenkinsfile
File metadata and controls
40 lines (39 loc) · 1.53 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
node {
withEnv(["ARTIFACT_DIR=${WORKSPACE}/artifacts"]) {
withCredentials([string(credentialsId: 'LIBRARY_PATH', variable: 'LIBRARY_PATH')]) {
if (params.CLEAN_WORKSPACE) {
echo "CLEAN_WORKSPACE set: deleting everything"
cleanWs()
}
def checkoutBranch = BRANCH_NAME
def isMRBuild = env.CHANGE_ID != null
def extensions = scm.extensions + [
[$class: 'CleanCheckout'],
[$class: 'SubmoduleOption',
disableSubmodules: false,
parentCredentials: true,
recursiveSubmodules: true,
trackingSubmodules: true
]
]
if (isMRBuild) {
checkoutBranch = env.CHANGE_BRANCH
// Filter out MergeWithGitSCMExtension to prevent automatic merge
extensions = extensions.findAll { extension ->
!(extension instanceof jenkins.plugins.git.MergeWithGitSCMExtension)
}
}
dir('ouster-sdk') {
checkout([
$class : 'GitSCM',
branches : [[name: "*/${checkoutBranch}"]],
extensions: extensions,
userRemoteConfigs: scm.userRemoteConfigs
])
}
dir(env.ARTIFACT_DIR) { deleteDir() }
def run_pipeline = load "${LIBRARY_PATH}"
run_pipeline()
}
}
}