-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
42 lines (29 loc) · 790 Bytes
/
install.sh
File metadata and controls
42 lines (29 loc) · 790 Bytes
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
40
41
42
#!/bin/bash
set -e
REPO="AB527/AWSEasyDeploy"
PROJECT="AWSEasyDeploy"
BINARY="easy-deploy"
OS=$(uname | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)
[ "$ARCH" = "x86_64" ] && ARCH="amd64"
echo "Fetching latest version..."
TAG=$(curl -s https://api.github.com/repos/$REPO/releases/latest \
| grep tag_name \
| cut -d '"' -f4)
VERSION=${TAG#v}
FILE="${PROJECT}_${VERSION}_${OS}_${ARCH}.tar.gz"
URL="https://github.com/$REPO/releases/download/${TAG}/${FILE}"
echo "Installing $PROJECT v$VERSION..."
echo "Downloading: $FILE"
TMP=$(mktemp)
if ! curl -fL "$URL" -o "$TMP"; then
echo "Failed to download binary"
echo "Expected: $FILE"
exit 1
fi
tar -xzf "$TMP"
rm "$TMP"
chmod +x $BINARY
sudo mv $BINARY /usr/local/bin/
echo "Installed successfully"
echo "Run: easy-deploy"