Skip to content

Commit ff38e04

Browse files
committed
[ci] Update Jenkinsfile build artifact gathering
Previously, hw_deployment_* directories were being found. The result of this "find" was a list of directory paths which Jenkins was not handling correctly. Removed this find and instead wrapped the copy in a try/catch, if an error occurs catch it and error accordingly.
1 parent 20e0c2b commit ff38e04

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

docker/jenkins/Jenkinsfile

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -324,21 +324,17 @@ void runDockerPytestWithMarker(String marker, String testResultsFilename, String
324324
sh """./run-docker.sh python -m pytest -m ${marker} --junitxml=${testResultsFilename}.xml --html=${testResultsFilename}.html --self-contained-html ${additionalOptions}"""
325325
}
326326

327-
def findBoardBuildFiles(String searchDir, String dirToFind) {
328-
def result = sh(script: "find $searchDir -type d -name \"$dirToFind*\"", returnStdout: true).trim()
329-
if (result.empty) {
330-
error "Directory containing '$dirToFind' not found."
331-
}
332-
return result
333-
}
334-
335327
void findCopyZip(String board, String findDir, String copyDir) {
336-
def buildDir = findBoardBuildFiles(findDir, "hw_deployment_${board}")
337-
sh "cp -r ${buildDir}/${board} ${copyDir}/"
338-
dir(copyDir) {
339-
sh "zip -r ${board}.zip ${board}/"
340-
sh "mkdir -p ${env.ARTIFACT_DIR}/${copyDir}/"
341-
sh "cp ${board}.zip ${env.ARTIFACT_DIR}/${copyDir}/"
328+
sh "mkdir -p ${copyDir}"
329+
try {
330+
sh "cp -r ${findDir}/hw_deployment_*/${board} ${copyDir}/"
331+
dir(copyDir) {
332+
sh "zip -r ${board}.zip ${board}/"
333+
sh "mkdir -p ${env.ARTIFACT_DIR}/${copyDir}/"
334+
sh "cp ${board}.zip ${env.ARTIFACT_DIR}/${copyDir}/"
335+
}
336+
} catch (err) {
337+
error "No ${board} hw_deployment_* build artifacts found in ${findDir}"
342338
}
343339
}
344340

0 commit comments

Comments
 (0)