From 500c25abfb69cf65626d83cbe0c60a0a9136a505 Mon Sep 17 00:00:00 2001 From: Craig Oates Date: Sat, 29 Oct 2022 20:31:21 +0100 Subject: [PATCH] add makefile with basic functionality. This is just an initial commit of the file. I will need to add to this as I get this website close to production-ready status. --- makefile | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 makefile diff --git a/makefile b/makefile new file mode 100644 index 0000000..66d5383 --- /dev/null +++ b/makefile @@ -0,0 +1,45 @@ +LISP ?= sbcl + +help: + @echo 'Usage: make [command]' + @echo + @echo 'Commands to run on server:' + @echo ' setup Install Debian packages and Quicklisp for website.' + @echo + @echo ' service Set-up and start systemd service.' + @echo + @echo ' http Add ritherdon-archive to nginx (http only).' + @echo + @echo ' run Run ritherdon-archive (port 5000).' + @echo + @echo 'Default target:' + @echo ' help Show this help message.' + +# Commands for Server +# ============================================================================== +setup: + apt update + apt -y intall certbot sbcl rlwrap nginx + curl https://beta.quicklisp.org/quicklisp.lisp + sbcl --load "/usr/share/common-lisp/source/quicklisp/quicklisp.lisp" \ + --eval (quicklisp-quickstart:install) \ + --eval (ql:add-to-init-file) \ + --quit + @echo 'Setup complete.' + +service: + @echo 'Setting up systemd service... NOT IMPLEMENTED' + sytemctl enable "conf/ritherdon-archive.service" + systemctl daemon-reload + systemctl start ritherdon-archive + @echo 'systemd set-up and running.' + +http: + @echo 'Adding ritherdon-archive to nginx... NOT IMPLEMENTED' + systemctl restart nginx + @echo 'ritherdon-archive added to nginx (HTTP only).' + +run: + rlwrap $(LISP) --eval '(ql:quickload :ritherdon-archive)' \ + --eval '(setf (osicat:environment-variable "APP_ENV") "production")' \ + --eval '(ritherdon-archive:main :port 5000)'