forked from goss-org/goss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
39 lines (32 loc) · 995 Bytes
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
{
set -e
LATEST="v0.3.5"
DGOSS_VER=$GOSS_VER
if [ -z "$GOSS_VER" ]; then
GOSS_VER=${GOSS_VER:-$LATEST}
DGOSS_VER='master'
fi
GOSS_DST=${GOSS_DST:-/usr/local/bin}
INSTALL_LOC="${GOSS_DST%/}/goss"
DGOSS_INSTALL_LOC="${GOSS_DST%/}/dgoss"
touch "$INSTALL_LOC" || { echo "ERROR: Cannot write to $GOSS_DST set GOSS_DST elsewhere or use sudo"; exit 1; }
arch=""
if [ "$(uname -m)" = "x86_64" ]; then
arch="amd64"
else
arch="386"
fi
url="https://github.com/aelsabbahy/goss/releases/download/$GOSS_VER/goss-linux-$arch"
echo "Downloading $url"
curl -L "$url" -o "$INSTALL_LOC"
chmod +rx "$INSTALL_LOC"
echo "Goss $GOSS_VER has been installed to $INSTALL_LOC"
echo "goss --version"
"$INSTALL_LOC" --version
dgoss_url="https://raw.githubusercontent.com/aelsabbahy/goss/$DGOSS_VER/extras/dgoss/dgoss"
echo "Downloading $dgoss_url"
curl -L "$dgoss_url" -o "$DGOSS_INSTALL_LOC"
chmod +rx "$DGOSS_INSTALL_LOC"
echo "dgoss $DGOSS_VER has been installed to $DGOSS_INSTALL_LOC"
}