]> granicus.if.org Git - postgis/commitdiff
Add -s switch to check_all_upgrades to stop on first failure
authorSandro Santilli <strk@kbt.io>
Thu, 28 Mar 2019 16:51:58 +0000 (16:51 +0000)
committerSandro Santilli <strk@kbt.io>
Thu, 28 Mar 2019 16:51:58 +0000 (16:51 +0000)
Also have Dronie use that switch.
Closes #4360

git-svn-id: http://svn.osgeo.org/postgis/trunk@17363 b70326c6-7e19-0410-871a-916f4a2858ee

.drone-1.0.yml
utils/check_all_upgrades.sh

index 2a434d62e8a030b438b06f8c2282b4d0a4a45eb6..08067a82dcdaa8a9ce0cf8e9b0bf4ef4bf89a703 100644 (file)
@@ -24,7 +24,7 @@ steps:
       - psql -c "select version()" template1
       - make check RUNTESTFLAGS=-v
       - make install
-      - utils/check_all_upgrades.sh
+      - utils/check_all_upgrades.sh -s
         `grep '^POSTGIS_' Version.config | cut -d= -f2 | paste -sd '.'`
 ---
 test-image: &test-image docker.kbt.io/postgis/build-test:trisquel2
@@ -47,7 +47,7 @@ steps:
       - psql -c "select version()" template1
       - make check RUNTESTFLAGS=-v
       - make install
-      - utils/check_all_upgrades.sh
+      - utils/check_all_upgrades.sh -s
         `grep '^POSTGIS_' Version.config | cut -d= -f2 | paste -sd '.'`
 ---
 test-image: &test-image docker.kbt.io/postgis/build-test:trisquel2
@@ -70,6 +70,6 @@ steps:
       - psql -c "select version()" template1
       - make check RUNTESTFLAGS=-v
       - make install
-      - utils/check_all_upgrades.sh
+      - utils/check_all_upgrades.sh -s
         `grep '^POSTGIS_' Version.config | cut -d= -f2 | paste -sd '.'`
 ...
index 5363650c2f0f9edc7c3f61d5e9902cde8dbcaf0a..51c4d8b3e8127e2b977c2bc4f39ffcff81dd2689 100755 (executable)
@@ -1,11 +1,20 @@
 #!/bin/sh
 
 if test -z "$1"; then
-  echo "Usage: $0 <to_version>" >&2
+  echo "Usage: $0 [-s] <to_version>" >&2
+  echo "Options:" >&2
+  echo "\t-s  Stop on first failure" >&2
   exit 1
 fi
+EXIT_ON_FIRST_FAILURE=0
+
+if test "$1" = "-s"; then
+  EXIT_ON_FIRST_FAILURE=1
+  shift
+fi
 to_version="$1"
 
+
 # Return -1, 1 or 0 if the first version
 # is respectively smaller, greater or equal
 # to the second version
@@ -53,6 +62,9 @@ fi
 echo "INFO: installed extensions: $INSTALLED_EXTENSIONS"
 
 for EXT in ${INSTALLED_EXTENSIONS}; do
+  if test $EXIT_ON_FIRST_FAILURE != 0 -a $failures != 0; then
+    exit $failures
+  fi
   if test "${EXT}" = "postgis"; then
     REGDIR=${BUILDDIR}/regress
   elif test "${EXT}" = "postgis_topology"; then