From 96b8b6a448554d3e170709056f45721685b145ad Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Fri, 3 Nov 2023 11:13:40 +0100 Subject: [PATCH] fail on install error --- infrastructure/backup/image/resources/backup.sh | 2 +- infrastructure/backup/image/resources/end-maintenance.sh | 2 +- infrastructure/backup/image/resources/entrypoint.sh | 2 ++ infrastructure/backup/image/resources/init.sh | 2 ++ infrastructure/backup/image/resources/install.sh | 2 ++ infrastructure/backup/image/resources/list-snapshots.sh | 2 +- infrastructure/backup/image/resources/restore.sh | 2 +- infrastructure/backup/image/resources/start-maintenance.sh | 2 +- infrastructure/nextcloud/image/resources/entrypoint.sh | 3 ++- infrastructure/nextcloud/image/resources/install.sh | 2 +- 10 files changed, 14 insertions(+), 7 deletions(-) diff --git a/infrastructure/backup/image/resources/backup.sh b/infrastructure/backup/image/resources/backup.sh index b7fe1be..a0d858d 100755 --- a/infrastructure/backup/image/resources/backup.sh +++ b/infrastructure/backup/image/resources/backup.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -o pipefail +set -eux pipefail function main() { diff --git a/infrastructure/backup/image/resources/end-maintenance.sh b/infrastructure/backup/image/resources/end-maintenance.sh index 0976fe5..1333db3 100644 --- a/infrastructure/backup/image/resources/end-maintenance.sh +++ b/infrastructure/backup/image/resources/end-maintenance.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -x +set -eux pipefail if test -f "/var/backups/config/config.orig"; then diff --git a/infrastructure/backup/image/resources/entrypoint.sh b/infrastructure/backup/image/resources/entrypoint.sh index 480c971..083ca6a 100755 --- a/infrastructure/backup/image/resources/entrypoint.sh +++ b/infrastructure/backup/image/resources/entrypoint.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -eux pipefail + function main() { file_env POSTGRES_DB file_env POSTGRES_PASSWORD diff --git a/infrastructure/backup/image/resources/init.sh b/infrastructure/backup/image/resources/init.sh index 5767e69..ed8fc2c 100755 --- a/infrastructure/backup/image/resources/init.sh +++ b/infrastructure/backup/image/resources/init.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -eux pipefail + function main() { file_env AWS_ACCESS_KEY_ID file_env AWS_SECRET_ACCESS_KEY diff --git a/infrastructure/backup/image/resources/install.sh b/infrastructure/backup/image/resources/install.sh index 1fe81e5..c1e7123 100755 --- a/infrastructure/backup/image/resources/install.sh +++ b/infrastructure/backup/image/resources/install.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -eux pipefail + install -m 0700 /tmp/entrypoint.sh / install -m 0700 /tmp/entrypoint-start-and-wait.sh / diff --git a/infrastructure/backup/image/resources/list-snapshots.sh b/infrastructure/backup/image/resources/list-snapshots.sh index b62a34a..347417d 100755 --- a/infrastructure/backup/image/resources/list-snapshots.sh +++ b/infrastructure/backup/image/resources/list-snapshots.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -o pipefail +set -eux pipefail function list-snapshot-files() { if [ -z ${CERTIFICATE_FILE} ]; diff --git a/infrastructure/backup/image/resources/restore.sh b/infrastructure/backup/image/resources/restore.sh index 0098b86..7670e4b 100755 --- a/infrastructure/backup/image/resources/restore.sh +++ b/infrastructure/backup/image/resources/restore.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -Eeox pipefail +set -eux pipefail function main() { local role_snapshot_id="${1:-latest}" diff --git a/infrastructure/backup/image/resources/start-maintenance.sh b/infrastructure/backup/image/resources/start-maintenance.sh index e3bbace..85640ae 100644 --- a/infrastructure/backup/image/resources/start-maintenance.sh +++ b/infrastructure/backup/image/resources/start-maintenance.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -x +set -eux pipefail if [ ! -f "/var/backups/config/config.orig" ]; then diff --git a/infrastructure/nextcloud/image/resources/entrypoint.sh b/infrastructure/nextcloud/image/resources/entrypoint.sh index aedef7d..51ea448 100644 --- a/infrastructure/nextcloud/image/resources/entrypoint.sh +++ b/infrastructure/nextcloud/image/resources/entrypoint.sh @@ -1,5 +1,6 @@ #!/bin/sh -set -eu + +set -eux pipefail # version_greater A B returns whether A > B version_greater() { diff --git a/infrastructure/nextcloud/image/resources/install.sh b/infrastructure/nextcloud/image/resources/install.sh index 2111956..ed88348 100755 --- a/infrastructure/nextcloud/image/resources/install.sh +++ b/infrastructure/nextcloud/image/resources/install.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -Eeo pipefail +set -eux pipefail apt update && apt -qqy install postgresql-client > /dev/null