From f73b03a06e7bbc363cb851a9fd31b4a7c4d42716 Mon Sep 17 00:00:00 2001 From: Akash A Date: Thu, 13 Jun 2019 21:58:48 +0100 Subject: [PATCH 1/2] add create-release script creates a tar ball in `target` directory and writes a report --- .gitignore | 4 ++-- create-release.sh | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100755 create-release.sh diff --git a/.gitignore b/.gitignore index c742e6a..571d6e1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ .DS_Store - -*.iml \ No newline at end of file +*.iml +target diff --git a/create-release.sh b/create-release.sh new file mode 100755 index 0000000..ff5eaf5 --- /dev/null +++ b/create-release.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +set -e + +OUTPUT_DIR=target +TAR_FILE=${OUTPUT_DIR}/dev-nginx.tar.gz +REPORT_FILE=${OUTPUT_DIR}/report.txt + +rm -rf ${OUTPUT_DIR} +mkdir -p ${OUTPUT_DIR} + +tar -zcf ${TAR_FILE} bin script +SHA256=$(shasum -a 256 ${TAR_FILE}) + +echo -e "$(date)\n${SHA256}" >> ${REPORT_FILE} + +cat ${REPORT_FILE} From f233d03850297f741a8af5f997328730be71565b Mon Sep 17 00:00:00 2001 From: Akash A Date: Thu, 13 Jun 2019 21:59:43 +0100 Subject: [PATCH 2/2] always fail fast --- script/add-to-hosts-file | 2 ++ script/link-config | 2 ++ script/locate-nginx | 2 ++ script/restart-nginx | 2 ++ 4 files changed, 8 insertions(+) diff --git a/script/add-to-hosts-file b/script/add-to-hosts-file index 207e96b..ff21482 100755 --- a/script/add-to-hosts-file +++ b/script/add-to-hosts-file @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -e + # colours YELLOW='\033[1;33m' NC='\033[0m' # no colour - reset console colour diff --git a/script/link-config b/script/link-config index a21188e..e328a86 100755 --- a/script/link-config +++ b/script/link-config @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -e + # colours YELLOW='\033[1;33m' NC='\033[0m' # no colour - reset console colour diff --git a/script/locate-nginx b/script/locate-nginx index c7426a5..a6d81b1 100755 --- a/script/locate-nginx +++ b/script/locate-nginx @@ -1,3 +1,5 @@ #!/usr/bin/env bash +set -e + nginx -V 2>&1 | grep "configure arguments:" | sed 's/[^*]*conf-path=\([^ ]*\)\/nginx\.conf.*/\1/g' diff --git a/script/restart-nginx b/script/restart-nginx index b48aa82..f7c709d 100755 --- a/script/restart-nginx +++ b/script/restart-nginx @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -e + # colours YELLOW='\033[1;33m' NC='\033[0m' # no colour - reset console colour