36 lines
934 B
Bash
36 lines
934 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
ROOT_DIR=$(dirname $(readlink -f "$0"))/..
|
||
|
|
||
|
. ${ROOT_DIR}/.env
|
||
|
|
||
|
if [ -f ${ROOT_DIR}/installed ]; then
|
||
|
echo "RVR is already installed! To force reinstall, delete file 'installed' from the root directory!"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
echo "Installing NPM packages..."
|
||
|
(cd ${ROOT_DIR}/multi && npm install)
|
||
|
|
||
|
echo "Installing Yarn packages..."
|
||
|
(cd ${ROOT_DIR}/public/static && yarn install)
|
||
|
|
||
|
echo "Installing RVR DB..."
|
||
|
mysql --host=${DB_HOST} --user=${DB_USER} --password=${DB_PASSWORD} ${DB_NAME} < ${ROOT_DIR}/database/rvr.sql
|
||
|
|
||
|
echo "Migrating DB..."
|
||
|
(cd ${ROOT_DIR} && ./rvr db:migrate)
|
||
|
|
||
|
if [ -z "${DEV}" ] || [ "${DEV}" -eq "0" ]; then
|
||
|
echo "Minifying JS, CSS and SVG files..."
|
||
|
${ROOT_DIR}/scripts/minify.sh
|
||
|
|
||
|
echo "Linking view files..."
|
||
|
(cd ${ROOT_DIR} && ./rvr view:link)
|
||
|
else
|
||
|
echo "Creating the first user..."
|
||
|
(cd ${ROOT_DIR} && ./rvr user:add rvr@rvr.dev 123456 admin)
|
||
|
fi
|
||
|
|
||
|
touch ${ROOT_DIR}/installed
|