From fb5dcd33694170e8690027d33a2ba834989844a8 Mon Sep 17 00:00:00 2001 From: undefined Date: Sat, 10 Oct 2020 22:14:44 +0800 Subject: [PATCH] feat: install script --- install/ubuntu-1804.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 install/ubuntu-1804.sh diff --git a/install/ubuntu-1804.sh b/install/ubuntu-1804.sh new file mode 100644 index 00000000..954f3c3e --- /dev/null +++ b/install/ubuntu-1804.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# Basic +apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4 +echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-4.0.list +apt-get update +apt-get install curl wget unzip + +# Install MongoDB +apt-get install -y mongodb-org +apt-get clean +mkdir -p /data/db + +# Install NodeJS +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh | bash +export $NVM_DIR=/root/.nvm +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" +nvm install 14 +nvm use 14 + +# Install HydroOJ +npm i yarn -g +yarn global add hydrooj @hydrooj/ui-default + +# TODO: auto-config & start? pm2 daemon? + +# Finish +echo "Done! use 'hydrooj' to start."