[PATCH v3 3/5] docker: *Really* don't require rebuilding if unncessary

Stephen Finucane stephen at that.guru
Sun Jun 9 03:36:20 AEST 2019


In commit 0b5b4e8cb3d0, we modified the docker entrypoint so it would
stop exiting whenever requirements changes were detected, instead opting
to allow the user to decide if things should be rebuilt or not.
Unfortunately the use of the '-e' option for the 'set' builtin means all
commands that fail will result in the script exiting. We don't want this
here.

Fix the issue by temporarily setting '+e' before and after this command,
resolving the issue.

Signed-off-by: Stephen Finucane <stephen at that.guru>
Fixes: 0b5b4e8cb3d0 ("docker: Don't require rebuilding if unnecessary")
---
 tools/docker/entrypoint.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/docker/entrypoint.sh b/tools/docker/entrypoint.sh
index 32f7132a..8a8c99a5 100755
--- a/tools/docker/entrypoint.sh
+++ b/tools/docker/entrypoint.sh
@@ -68,6 +68,7 @@ EOF
 fi
 
 # check if we need to rebuild because requirements changed
+set +e
 for x in /tmp/requirements-*.txt; do
     if ! cmp $x ~/patchwork/$(basename $x); then
         cat << EOF
@@ -80,6 +81,7 @@ EOF
         diff -u $x ~/patchwork/$(basename $x)
     fi
 done
+set -e
 
 # check if db is connected
 if ! test_db_connection; then
-- 
2.21.0



More information about the Patchwork mailing list