ci: Add missing "set -e" to scripts run by su.

If any shell command fails, the whole script should fail.  To avoid
future omissions, add this even for single-command scripts that use su
with heredoc syntax, as they might be extended or copied-and-pasted.

Extracted from a larger patch that wanted to use #error during
compilation, leading to the diagnosis of this problem.

Reviewed-by: Tristan Partin <tristan@partin.io> (earlier version)
Discussion: https://postgr.es/m/DDZP25P4VZ48.3LWMZBGA1K9RH%40partin.io
Backpatch-through: 15
REL_15_STABLE
Thomas Munro 1 month ago
parent 13efc28d4b
commit c3359d1cf5
  1. 3
      .cirrus.tasks.yml

@ -76,6 +76,7 @@ task:
# freebsd already takes longer than other platforms except for windows. # freebsd already takes longer than other platforms except for windows.
configure_script: | configure_script: |
su postgres <<-EOF su postgres <<-EOF
set -e
./configure \ ./configure \
--enable-cassert --enable-debug --enable-tap-tests \ --enable-cassert --enable-debug --enable-tap-tests \
--enable-nls \ --enable-nls \
@ -181,6 +182,7 @@ task:
configure_script: | configure_script: |
su postgres <<-EOF su postgres <<-EOF
set -e
./configure \ ./configure \
--enable-cassert --enable-debug --enable-tap-tests \ --enable-cassert --enable-debug --enable-tap-tests \
--enable-nls \ --enable-nls \
@ -198,6 +200,7 @@ task:
test_world_script: | test_world_script: |
su postgres <<-EOF su postgres <<-EOF
set -e
ulimit -c unlimited # default is 0 ulimit -c unlimited # default is 0
make -s ${CHECK} ${CHECKFLAGS} -j${TEST_JOBS} make -s ${CHECK} ${CHECKFLAGS} -j${TEST_JOBS}
EOF EOF

Loading…
Cancel
Save