From a0c354df8ea3126a8e3a1cea6cbb61560956099a Mon Sep 17 00:00:00 2001 From: Chris Bartlett Date: Tue, 23 Apr 2019 10:53:15 -0600 Subject: [PATCH 1/3] Fail build scripts if any command fails --- scripts/build.sh | 2 ++ scripts/publish_docker.sh | 2 ++ scripts/release.sh | 2 ++ scripts/update_installer.sh | 2 ++ 4 files changed, 8 insertions(+) diff --git a/scripts/build.sh b/scripts/build.sh index 705e836..6b52f5b 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,5 +1,7 @@ #!/bin/sh +set -e + VERSION=${1:-master} GOOS=${2:-linux} DOCKER_REPO="readytalk/stim" diff --git a/scripts/publish_docker.sh b/scripts/publish_docker.sh index c49a4ad..46481a5 100755 --- a/scripts/publish_docker.sh +++ b/scripts/publish_docker.sh @@ -1,5 +1,7 @@ #!/bin/sh +set -e + SOURCE_VERSION=${1:-master} PUBLISH_VERSION=${2:-$SOURCE_VERSION} DOCKER_REPO="readytalk/stim" diff --git a/scripts/release.sh b/scripts/release.sh index 19cc3bf..d2c0286 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e + body='{ "request": { "branch":"master" diff --git a/scripts/update_installer.sh b/scripts/update_installer.sh index 1a8287f..ec95d31 100755 --- a/scripts/update_installer.sh +++ b/scripts/update_installer.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e + VERSION=${1:-master} mkdir -p bin From 3a50a280aada7870e738d2a25eee051ede74a969 Mon Sep 17 00:00:00 2001 From: Chris Bartlett Date: Tue, 23 Apr 2019 21:09:26 -0600 Subject: [PATCH 2/3] Adding pipefail to scripts --- scripts/build.sh | 2 +- scripts/publish_docker.sh | 2 +- scripts/release.sh | 2 +- scripts/update_installer.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 6b52f5b..c4a00b7 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,6 +1,6 @@ #!/bin/sh -set -e +set -eo pipefail VERSION=${1:-master} GOOS=${2:-linux} diff --git a/scripts/publish_docker.sh b/scripts/publish_docker.sh index 46481a5..585eee8 100755 --- a/scripts/publish_docker.sh +++ b/scripts/publish_docker.sh @@ -1,6 +1,6 @@ #!/bin/sh -set -e +set -eo pipefail SOURCE_VERSION=${1:-master} PUBLISH_VERSION=${2:-$SOURCE_VERSION} diff --git a/scripts/release.sh b/scripts/release.sh index d2c0286..46632da 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -eo pipefail body='{ "request": { diff --git a/scripts/update_installer.sh b/scripts/update_installer.sh index ec95d31..8ca69f8 100755 --- a/scripts/update_installer.sh +++ b/scripts/update_installer.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -eo pipefail VERSION=${1:-master} From eadac5ebff745a23e8456e5dc20fd3aa448998ba Mon Sep 17 00:00:00 2001 From: Chris Bartlett Date: Tue, 23 Apr 2019 21:14:46 -0600 Subject: [PATCH 3/3] Changing scripts to all use bash --- scripts/build.sh | 2 +- scripts/publish_docker.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index c4a00b7..3d49693 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -eo pipefail diff --git a/scripts/publish_docker.sh b/scripts/publish_docker.sh index 585eee8..700141d 100755 --- a/scripts/publish_docker.sh +++ b/scripts/publish_docker.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -eo pipefail