From 4b29115750dcd83062ebb837860738f4f9043e98 Mon Sep 17 00:00:00 2001 From: Artiom Diomin Date: Thu, 13 Jun 2019 19:13:44 +0300 Subject: [PATCH] Make gobetween.sh universal across different OS Signed-off-by: Artiom Diomin --- examples/terraform/hetzner/gobetween.sh | 27 +++++++++++++---------- examples/terraform/openstack/gobetween.sh | 17 ++++++++------ examples/terraform/packet/gobetween.sh | 27 +++++++++++++---------- examples/terraform/vsphere/gobetween.sh | 17 ++++++++------ 4 files changed, 50 insertions(+), 38 deletions(-) diff --git a/examples/terraform/hetzner/gobetween.sh b/examples/terraform/hetzner/gobetween.sh index cd20b489d..a53bf382c 100755 --- a/examples/terraform/hetzner/gobetween.sh +++ b/examples/terraform/hetzner/gobetween.sh @@ -17,17 +17,20 @@ # This script is mostly used in CI # It installs dependencies and starts the tests -set -xe +set -euf -o pipefail + +GOBETWEEN_VERSION=0.7.0 mkdir /tmp/gobetween cd /tmp/gobetween -curl -L -o gobetween_0.7.0_linux_amd64.tar.gz \ - https://github.com/yyyar/gobetween/releases/download/0.7.0/gobetween_0.7.0_linux_amd64.tar.gz -tar xvf gobetween_0.7.0_linux_amd64.tar.gz -mv gobetween /usr/local/sbin/gobetween -chown root:root /usr/local/sbin/gobetween - -cat < /etc/systemd/system/gobetween.service +curl -L -o gobetween_${GOBETWEEN_VERSION}_linux_amd64.tar.gz \ + https://github.com/yyyar/gobetween/releases/download/${GOBETWEEN_VERSION}/gobetween_${GOBETWEEN_VERSION}_linux_amd64.tar.gz +tar xvf gobetween_${GOBETWEEN_VERSION}_linux_amd64.tar.gz +sudo mkdir -p /opt/bin +sudo mv gobetween /opt/bin/gobetween +sudo chown root:root /opt/bin/gobetween + +cat < /etc/systemd/system/gobetween.service +curl -L -o gobetween_${GOBETWEEN_VERSION}_linux_amd64.tar.gz \ + https://github.com/yyyar/gobetween/releases/download/${GOBETWEEN_VERSION}/gobetween_${GOBETWEEN_VERSION}_linux_amd64.tar.gz +tar xvf gobetween_${GOBETWEEN_VERSION}_linux_amd64.tar.gz +sudo mkdir -p /opt/bin +sudo mv gobetween /opt/bin/gobetween +sudo chown root:root /opt/bin/gobetween + +cat <