Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make gobetween.sh universal across different OS #494

Merged
merged 1 commit into from
Jun 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions examples/terraform/hetzner/gobetween.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF > /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 <<EOF | sudo tee /etc/systemd/system/gobetween.service
[Unit]
Description=Gobetween - modern LB for cloud era
Documentation=https://github.com/yyyar/gobetween/wiki
Expand All @@ -36,7 +39,7 @@ After=network.target remote-fs.target nss-lookup.target
[Service]
Type=simple
PIDFile=/run/gobetween.pid
ExecStart=/usr/local/sbin/gobetween -c /etc/gobetween.toml
ExecStart=/opt/bin/gobetween -c /etc/gobetween.toml
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
Expand All @@ -47,6 +50,6 @@ Group=nogroup
WantedBy=multi-user.target
EOF

systemctl daemon-reload
systemctl enable gobetween.service
systemctl start gobetween.service
sudo systemctl daemon-reload
sudo systemctl enable gobetween.service
sudo systemctl start gobetween.service
17 changes: 10 additions & 7 deletions examples/terraform/openstack/gobetween.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@
# 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
sudo mv gobetween /usr/local/sbin/gobetween
sudo chown root:root /usr/local/sbin/gobetween
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 <<EOF | sudo tee /etc/systemd/system/gobetween.service
[Unit]
Expand All @@ -36,7 +39,7 @@ After=network.target remote-fs.target nss-lookup.target
[Service]
Type=simple
PIDFile=/run/gobetween.pid
ExecStart=/usr/local/sbin/gobetween -c /etc/gobetween.toml
ExecStart=/opt/bin/gobetween -c /etc/gobetween.toml
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
Expand Down
27 changes: 15 additions & 12 deletions examples/terraform/packet/gobetween.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF > /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 <<EOF | sudo tee /etc/systemd/system/gobetween.service
[Unit]
Description=Gobetween - modern LB for cloud era
Documentation=https://github.com/yyyar/gobetween/wiki
Expand All @@ -36,7 +39,7 @@ After=network.target remote-fs.target nss-lookup.target
[Service]
Type=simple
PIDFile=/run/gobetween.pid
ExecStart=/usr/local/sbin/gobetween -c /etc/gobetween.toml
ExecStart=/opt/bin/gobetween -c /etc/gobetween.toml
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
Expand All @@ -47,6 +50,6 @@ Group=nogroup
WantedBy=multi-user.target
EOF

systemctl daemon-reload
systemctl enable gobetween.service
systemctl start gobetween.service
sudo systemctl daemon-reload
sudo systemctl enable gobetween.service
sudo systemctl start gobetween.service
17 changes: 10 additions & 7 deletions examples/terraform/vsphere/gobetween.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@
# 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
sudo mv gobetween /usr/local/sbin/gobetween
sudo chown root:root /usr/local/sbin/gobetween
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 <<EOF | sudo tee /etc/systemd/system/gobetween.service
[Unit]
Expand All @@ -36,7 +39,7 @@ After=network.target remote-fs.target nss-lookup.target
[Service]
Type=simple
PIDFile=/run/gobetween.pid
ExecStart=/usr/local/sbin/gobetween -c /etc/gobetween.toml
ExecStart=/opt/bin/gobetween -c /etc/gobetween.toml
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
Expand Down