-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdebian-amd64.sh
82 lines (65 loc) · 2.06 KB
/
debian-amd64.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
RELEASE_ID=$(lsb_release -is | tr '[:upper:]' '[:lower:]')
RELEASE_CODE=$(lsb_release -cs)
RELEASE_VERSION=$(lsb_release -rs)
echo ">> installing OmegaGraf for $RELEASE_ID/$RELEASE_CODE $RELEASE_VERSION"
# Prereqs
sudo apt update
sudo apt install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common acl
read -p "Would you like to enable SSL (BETA)? (y/n)" answer
case ${answer:0:1} in
y|Y )
echo "OK! I will be installing certs and running on HTTPS port 5001."
echo ""
echo ">> installing microsoft tooling for developer certs"
wget -q "https://packages.microsoft.com/config/$RELEASE_ID/$RELEASE_VERSION/packages-microsoft-prod.deb"
sudo dpkg -i packages-microsoft-prod.deb
sudo apt update
rm packages-microsoft-prod.deb
sudo apt install -y dotnet-sdk-3.1
dotnet dev-certs https
export OMEGAGRAF_HOST="https://0.0.0.0:5001"
;;
* )
echo "OK! I will be running on HTTP port 5000 by default."
export OMEGAGRAF_HOST="http://0.0.0.0:5000"
;;
esac
echo ">> installing docker"
# Add key
curl -fsSL "https://download.docker.com/linux/$RELEASE_ID/gpg" | sudo apt-key add -
# Add repo
RELEASE_CODE=$(lsb_release -cs)
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$RELEASE_ID $RELEASE_CODE stable"
# Install docker
sudo apt update
apt-cache policy docker-ce
sudo apt install -y docker-ce
# Check install
sudo systemctl status docker
docker -v
# Allow current user
sudo usermod -aG docker $USER
echo ">> downloading OmegaGraf"
# Remove old binaries
rm OmegaGraf*.tar.gz
rm OmegaGraf
# Download the latest OmegaGraf release
curl -s "https://api.github.com/repos/OmegaGraf/OmegaGraf/releases/latest" \
| grep "OmegaGraf.*tar.gz" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -qi -
# Extract the OmegaGraf binary
tar -xzf OmegaGraf*.tar.gz
# Create the default OmegaGraf data directory
mkdir data
chmod -R 777 data
# Allow execute on binary
chmod +x OmegaGraf
echo
echo "OmegaGraf installation script has completed!"
echo
echo "To run OmegaGraf, you can use:"
echo "./OmegaGraf --host $OMEGAGRAF_HOST"
echo