Skip to content

Commit

Permalink
Update make build vs make install process.
Browse files Browse the repository at this point in the history
  • Loading branch information
tchalvak committed Jan 28, 2023
1 parent bac1718 commit 0ec9b7e
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,19 @@ ifndef TESTFILE
TESTFILE=
endif

build: dep
create-directories:
@echo "Do this with sudo due to permissions"
mkdir -p $(JS)
mkdir -p ./deploy/templates/compiled ./deploy/templates/cache ./deploy/resources/logs/
touch ./deploy/resources/logs/deity.log
touch ./deploy/resources/logs/emails.log

build: dep
@echo "Don't forget to update nginx configs as necessary."
@echo "Including updating the php to retain login sessions longer."
cp -u -p ./deploy/resources.build.php ./deploy/resources.php
echo "Note that this does not overwrite existing resources.php"
php ./deploy/check.php
echo "Check that the webserver user has permissions to the script!"
@ln -sf "$(RELATIVE_COMPONENTS)jquery/jquery.min.js" "$(JS)"
@ln -sf "$(RELATIVE_COMPONENTS)jquery/jquery.min.map" "$(JS)"
Expand All @@ -55,18 +62,18 @@ js-deps:
corepack enable
echo "corepack enable DONE. Totally sidesteps having to install a yarn version"
yarn -v
corepack enable
yarn install --immutable

install: build start-chat writable
@echo "Don't forget to update webserver configs as necessary."
install: create-directories writable start-chat writable
@echo "Don't forget to update nginx configs as necessary."
@echo "Including updating the php to retain login sessions longer."
cp -u -p ./deploy/resources.build.php ./deploy/resources.php
echo "Note that this does not overwrite existing resources.php"
php ./deploy/check.php
echo "Check that the webserver user has permissions to the script!"

writable:
chmod -R ugo+rwX ./deploy/templates/compiled ./deploy/templates/cache ./deploy/resources/logs/
chown ${WEBUSER} ./deploy/resources/logs/*
mkdir -p ./deploy/templates/compiled ./deploy/templates/cache ./deploy/resources/logs/
chown ${WEBUSER} ./deploy/resources/logs/*
Expand Down Expand Up @@ -101,12 +108,16 @@ install-python: python-install
install-webserver:
apt install nginx

restart-webserver:
service nginx restart

install-database-client:
apt install postgresql-client

start-chat:
touch ./deploy/resources/logs/ninjawars.chat-server.log
chown ${WEBUSER} ./deploy/resources/logs/ninjawars.chat-server.log
chmod ugo+w ./deploy/resources/logs/ninjawars.chat-server.log
nohup php bin/chat-server.php > ./deploy/resources/logs/ninjawars.chat-server.log 2>&1 &

browse:
Expand Down

0 comments on commit 0ec9b7e

Please sign in to comment.