From 16507352d62b2a2c3b73d65402c830bf5ec17a80 Mon Sep 17 00:00:00 2001 From: Maxim Kuvyrkov Date: Fri, 1 Jun 2018 14:58:48 +0000 Subject: tcwg-update-tested.sh: Add handling for dockerfiles.git:tcwg-tested Change-Id: I5cecb64ffe897e1a2d7d4a4ad3dca6fb9195f69e --- tcwg-update-tested.sh | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) mode change 100644 => 100755 tcwg-update-tested.sh (limited to 'tcwg-update-tested.sh') diff --git a/tcwg-update-tested.sh b/tcwg-update-tested.sh old mode 100644 new mode 100755 index 640494e0..4ceda5f4 --- a/tcwg-update-tested.sh +++ b/tcwg-update-tested.sh @@ -9,6 +9,7 @@ convert_args_to_variables "$@" # for empty arguments. GIT_COMMIT="${GIT_COMMIT:-HEAD}" GIT_COMMIT_1="${GIT_COMMIT_1:-HEAD}" +GIT_COMMIT_2="${GIT_COMMIT_2:-HEAD}" verbose="${verbose:-true}" # Jenkins doesn't define variables when parameter value is empty, @@ -17,7 +18,29 @@ set -u if $verbose; then set -x; fi -git config --global user.name "TCWG Buildslave" -git config --global user.email tcwg-buildslave@linaro.org +if [ x"$USER" = x"tcwg-buildslave" ]; then + git config --global user.name "TCWG Buildslave" + git config --global user.email tcwg-buildslave@linaro.org +fi git -C abe push gerrit $GIT_COMMIT:refs/heads/tested git -C jenkins-scripts push gerrit $GIT_COMMIT_1:refs/heads/tested + +pushd dockerfiles +GIT_COMMIT_2=$(git rev-parse $GIT_COMMIT_2) +git review -s +git checkout -B tcwg-tested origin/tcwg-tested +if [ x"$(git diff HEAD $GIT_COMMIT_2)" != x"" ]; then + # Make sure to generate merge commit so that we can attach gerrit's Change-Id to it + git merge --no-ff -X theirs $GIT_COMMIT_2 + # Make sure there are no differences between merge result and $GIT_COMMIT_2 + if [ x"$(git diff HEAD $GIT_COMMIT_2)" != x"" ]; then + echo "ERROR: dockerfiles merge not clean" + exit 1 + fi + # Generate gerrit's Change-Id + git commit --amend + # Submit review against tcwg-llvmprod branch + git review tcwg-tested + ssh -p29418 review.linaro.org gerrit review --code-review 2 --submit $(git rev-parse HEAD) +fi +popd -- cgit v1.2.3