diff options
author | lonkaars <loek@pipeframe.xyz> | 2021-04-25 11:23:18 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2021-04-25 11:23:18 +0200 |
commit | 5244fab8678f1d3226efca8139695e89e6e0c23b (patch) | |
tree | 664615da39329d35b8e33516e6aa5317a509c7a5 /config | |
parent | ee5479c1c4bd992e108623e32cabb375512a57a2 (diff) |
moved to new config script with more options
Diffstat (limited to 'config')
-rwxr-xr-x | config | 75 |
1 files changed, 75 insertions, 0 deletions
@@ -0,0 +1,75 @@ +#!/bin/sh + +export $(cat .env | xargs) + +packages() { + sudo apt-get install \ + nodejs npm \ + python3 python3-venv python3-pip \ + make \ + gcc \ + sqlite3 libsqlite3-dev \ + nginx +} + +yarn_install() { + sudo npm i -g typescript yarn # install typescript compilers and yarn package manager globally using npm +} + +node_packages() { + yarn +} + +python_packages() { + python3 -m venv venv # create virtual environment + venv/bin/pip install -r requirements.txt # install the dependencies +} + +submodules() { + git submodule init + git submodule update +} + +database() { + cd database + sh init_db.sh + make + cd .. +} + +voerbak() { + cd voerbak + make + cd .. +} + +customize_config() { + sed "s/{{ connect4_dir }}/${CONNECT4_WEB_ROOT}/g" -i ./api.systemd.conf + sed "s/{{ connect4_user }}/$(whoami)/g" -i ./api.systemd.conf + sed "s/user nobody/user $(whoami)/" -i ./nginx.conf +} + +build() { + customize_config + npx next build + npx next export + mv out $CONNECT4_WEB_ROOT +} + +all() { + packages + yarn_install + node_packages + python_packages + submodules + database + voerbak +} + +if [[ -z $1 ]]; then + all + exit +fi + +$1 + |