diff options
author | zshi <zshi@redhat.com> | 2017-03-24 10:06:27 +0800 |
---|---|---|
committer | Aric Gardner <agardner@linuxfoundation.org> | 2017-03-28 12:43:54 +0000 |
commit | b18f528cd8b058d2c575e48c8882771fa63a9dcf (patch) | |
tree | b632d595a63c93a0c8f3adde3f42b09bd0a9fe96 /jjb/dovetail/dovetail-run.sh | |
parent | c580e947a59bc00996c6057c363f13e0398682a6 (diff) |
Change jenkins user:group name according to Node Name.
JIRA: DOVETAIL-377
Change-Id: I55eebdd55c2cf91d74d166b0b31a0601efe0a751
Signed-off-by: zshi <zshi@redhat.com>
Diffstat (limited to 'jjb/dovetail/dovetail-run.sh')
-rwxr-xr-x | jjb/dovetail/dovetail-run.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/jjb/dovetail/dovetail-run.sh b/jjb/dovetail/dovetail-run.sh index f9a3df626..4b00ec881 100755 --- a/jjb/dovetail/dovetail-run.sh +++ b/jjb/dovetail/dovetail-run.sh @@ -85,9 +85,11 @@ echo "Container exec command: ${run_cmd}" docker exec $container_id ${run_cmd} sudo cp -r ${DOVETAIL_REPO_DIR}/results ./ -#To make sure the file owner is jenkins, for the copied results files in the above line +#To make sure the file owner is the current user, for the copied results files in the above line #if not, there will be error when next time to wipe workspace -sudo chown -R jenkins:jenkins ${WORKSPACE}/results +CURRENT_USER=${SUDO_USER:-$USER} +PRIMARY_GROUP=$(id -gn $CURRENT_USER) +sudo chown -R ${CURRENT_USER}:${PRIMARY_GROUP} ${WORKSPACE}/results echo "Dovetail: done!" |