From 1861a2086b36a341e0b0f9e366f01e8df753379f Mon Sep 17 00:00:00 2001 From: johnnoel Date: Tue, 23 Jan 2024 12:09:06 +0000 Subject: [PATCH] [CI] Add cleanup for ownership issues observed on zynq boards --- docker/jenkins/Jenkinsfile_HW | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docker/jenkins/Jenkinsfile_HW b/docker/jenkins/Jenkinsfile_HW index 3436ec79e8..bd4180d83c 100644 --- a/docker/jenkins/Jenkinsfile_HW +++ b/docker/jenkins/Jenkinsfile_HW @@ -48,6 +48,7 @@ pipeline { post { always { stashResults("bnn_build_sanity", "${env.BOARD}") + cleanUpWorkspaceOwnership() } } } @@ -72,6 +73,7 @@ pipeline { post { always { stashResults("bnn_build_sanity", "${env.BOARD}") + cleanUpWorkspaceOwnership() } } } @@ -96,6 +98,7 @@ pipeline { post { always { stashResults("bnn_build_sanity", "${env.BOARD}") + cleanUpWorkspaceOwnership() } } } @@ -120,6 +123,7 @@ pipeline { post { always { stashResults("bnn_build_sanity", "${env.BOARD}") + cleanUpWorkspaceOwnership() } } } @@ -147,6 +151,7 @@ pipeline { post { always { stashResults("bnn_build_full", "${env.BOARD}") + cleanUpWorkspaceOwnership() } } } @@ -171,6 +176,7 @@ pipeline { post { always { stashResults("bnn_build_full", "${env.BOARD}") + cleanUpWorkspaceOwnership() } } } @@ -195,6 +201,7 @@ pipeline { post { always { stashResults("bnn_build_full", "${env.BOARD}") + cleanUpWorkspaceOwnership() } } } @@ -219,6 +226,7 @@ pipeline { post { always { stashResults("bnn_build_full", "${env.BOARD}") + cleanUpWorkspaceOwnership() } } } @@ -371,4 +379,10 @@ void stashResults (String testType, String board) { echo "No results to stash" } } -} \ No newline at end of file +} + +void cleanUpWorkspaceOwnership () { + if (env.USER_CREDENTIALS) { + sh 'echo ${USER_CREDENTIALS_PSW} | sudo -S chown -R $(id -u):$(id -g) ${WORKSPACE}' + } +}