diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2018-06-01 14:58:48 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2018-06-01 14:58:48 +0000 |
commit | 16507352d62b2a2c3b73d65402c830bf5ec17a80 (patch) | |
tree | 7da2139023ef50833f35636cd1136fb88ea82e4d /tcwg-update-tested.sh | |
parent | e8b908e1f84cf8896b3bd9e8357144fb51a70b22 (diff) |
tcwg-update-tested.sh: Add handling for dockerfiles.git:tcwg-tested
Change-Id: I5cecb64ffe897e1a2d7d4a4ad3dca6fb9195f69e
Diffstat (limited to 'tcwg-update-tested.sh')
-rwxr-xr-x[-rw-r--r--] | tcwg-update-tested.sh | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/tcwg-update-tested.sh b/tcwg-update-tested.sh index 640494e0..4ceda5f4 100644..100755 --- 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 |