Skip to content

Commit

Permalink
installer: enable make install
Browse files Browse the repository at this point in the history
This patch enables `make install` to allow for installing into a new directory.

Signed-off-by: Amy Parker <amy@amyip.net>
  • Loading branch information
amyipdev committed Aug 3, 2023
1 parent ba35f4c commit 8ce19f8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
SASS := sass
SASS_OPTIONS :=
SASS_SRCS = $(shell find scss/ -name '*.scss')
INSTALLDIR :=

# TODO: automatically compile sass instead of manual

Expand All @@ -32,4 +33,9 @@ all:
$(MAKE) -C js

ssvplwc:
cd srv/ssvplwc; cargo run --release
cd srv/ssvplwc; cargo run --release

install:
mkdir -p $(INSTALLDIR)
cp -a . $(INSTALLDIR)
chown -R $(USER):$(USER) $(INSTALLDIR)
16 changes: 15 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,22 @@ if [ "$INISCS" != "n" ]; then
python3 srv/initialized_cached_stats.py
fi

echo -n "Would you like to run the full installation now? n/[y] "
read CONTINS
if [ "$CONTINS" == "n" ]; then
echo "Existing SSVP installation wizard. Remember to set up cron jobs."
exit 0
fi

echo -n "Installation directory [current directory]: "
read INSDIR
if [ "$INSDIR" == "" ]; then
INSDIR=$(pwd)
fi

$PREROOT make install INSTALLDIR=$INSDIR

echo "Installation finished. Remember to set up a cron job for srv/interval.py to run every 5 minutes (this will be automated in the future)"

# next todo: cron (also implement systemd timers)
# next todo: get install directory (default: /opt/ssvp), `make install`
# next todo: systemd service for web server?

0 comments on commit 8ce19f8

Please sign in to comment.