diff options
author | Thiago Jung Bauermann <thiago.bauermann@linaro.org> | 2023-03-16 20:17:09 +0000 |
---|---|---|
committer | Thiago Jung Bauermann <thiago.bauermann@linaro.org> | 2023-03-16 20:17:09 +0000 |
commit | 369ae8f43d2a55dfc3b167615b125b03c925d223 (patch) | |
tree | 606503ba4c281b8eacedc2e6beb408de649fd717 | |
parent | dd27fbde7c35466983bf7ff55ed8f004cfee1230 (diff) |
tcwg-update-tested.sh: Make "git review" command work again
tcwg-abe-tested jobs have been failing with:
+ git review -s
Creating a git remote called 'gerrit' that maps to:
ssh://tcwg-buildslave@review.linaro.org:29418/ci/dockerfiles
Traceback (most recent call last):
File "/usr/local/bin/git-review", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.8/dist-packages/git_review/cmd.py", line 1844, in main
_main()
File "/usr/local/lib/python3.8/dist-packages/git_review/cmd.py", line 1761, in _main
set_hooks_commit_msg(remote, hook_file)
File "/usr/local/lib/python3.8/dist-packages/git_review/cmd.py", line 382, in set_hooks_commit_msg
os.mkdir(hooks_dir)
FileExistsError: [Errno 17] File exists: '/dev/null'
This happens because repos cloned by Jenkins have the core.hooksPath set to
/dev/null causing the git review to fail¹, therefore we need to change the
configuration value back to its default value.
¹ https://storyboard.openstack.org/#!/story/2010342
Change-Id: I31f64816568e923aa893fcd9d703ae14319614c5
-rwxr-xr-x | tcwg-update-tested.sh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tcwg-update-tested.sh b/tcwg-update-tested.sh index 286eaebc..332ed27c 100755 --- a/tcwg-update-tested.sh +++ b/tcwg-update-tested.sh @@ -28,6 +28,12 @@ git -C jenkins-scripts push gerrit $GIT_COMMIT_1:refs/heads/tested pushd dockerfiles GIT_COMMIT_2=$(git rev-parse $GIT_COMMIT_2) + +# Repos cloned by Jenkins have the core.hooksPath set to /dev/null, causing the git review +# command to fail (see https://storyboard.openstack.org/#!/story/2010342) so change it +# back to its default value. +git config --unset core.hooksPath + git review -s git checkout -B tcwg-tested origin/tcwg-tested if [ x"$(git diff HEAD $GIT_COMMIT_2 | wc -l)" != x"0" ]; then |