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}' + } +}