2018-04-10 00:37:40 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-04-10 10:37:59 +00:00
|
|
|
echo "Checking prerequisites..."
|
|
|
|
|
|
|
|
if hash go 2>/dev/null; then
|
2018-06-28 10:38:59 +00:00
|
|
|
if [[ ":$PATH:" == *":$GOPATH/bin:"* || ":$PATH:" == *":$GOPATH/bin/:"* ]]; then
|
|
|
|
go version
|
|
|
|
else
|
|
|
|
echo "Your \$PATH is missing \$GOPATH/bin, you should add this to your ~/.profile:"
|
|
|
|
echo "export PATH=\$PATH:/usr/local/go/bin:\$GOPATH/bin"
|
|
|
|
exit
|
|
|
|
fi
|
2018-04-10 10:37:59 +00:00
|
|
|
else
|
|
|
|
echo "Go is not installed"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
if hash tsc 2>/dev/null; then
|
|
|
|
tsc --version
|
|
|
|
else
|
|
|
|
echo "TypeScript is not installed"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
if hash git 2>/dev/null; then
|
|
|
|
git version
|
|
|
|
else
|
|
|
|
echo "Git is not installed"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
if hash git-lfs 2>/dev/null; then
|
|
|
|
git lfs version
|
|
|
|
else
|
|
|
|
echo "Git LFS is not installed"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Looks like the prerequisites were installed correctly!"
|
2018-04-10 11:10:13 +00:00
|
|
|
|
2018-04-10 17:46:22 +00:00
|
|
|
# Use sudo here to request permissions for later
|
2018-04-10 11:10:13 +00:00
|
|
|
sudo echo "---"
|
2018-04-10 10:37:59 +00:00
|
|
|
|
2018-04-10 00:37:40 +00:00
|
|
|
# Clone and build main repository
|
2018-04-25 22:30:37 +00:00
|
|
|
go get -t -v github.com/animenotifier/notify.moe/...
|
2018-04-10 00:37:40 +00:00
|
|
|
cd $GOPATH/src/github.com/animenotifier/notify.moe
|
|
|
|
make all
|
|
|
|
|
|
|
|
# Database
|
2018-04-11 10:55:53 +00:00
|
|
|
git clone --depth=1 https://github.com/animenotifier/database ~/.aero/db/arn
|
2018-04-10 00:37:40 +00:00
|
|
|
|
|
|
|
# Configure
|
|
|
|
make ports
|
2018-04-10 10:37:59 +00:00
|
|
|
|
|
|
|
# Add "127.0.0.1 beta.notify.moe" to /etc/hosts
|
2018-04-10 10:43:42 +00:00
|
|
|
if grep -Fxq "127.0.0.1 beta.notify.moe" /etc/hosts; then
|
|
|
|
echo "beta.notify.moe already resolves to localhost"
|
|
|
|
else
|
|
|
|
sudo -- sh -c -e "echo '127.0.0.1 beta.notify.moe' >> /etc/hosts"
|
|
|
|
echo "beta.notify.moe now resolves to localhost"
|
|
|
|
fi
|
2018-04-10 10:37:59 +00:00
|
|
|
|
|
|
|
# Test
|
2018-04-10 10:43:42 +00:00
|
|
|
make test
|
|
|
|
|
|
|
|
# Finished
|
|
|
|
echo "Finished installation."
|
|
|
|
echo "You can now execute the 'run' command and open https://beta.notify.moe in your browser."
|