diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e22cbf4 --- /dev/null +++ b/Makefile @@ -0,0 +1,23 @@ +# Define the source directory, read from the environment variable ALMANACK_ROOT +# Ensure to handle the case where ALMANACK_ROOT is not set +SRC_DIR := $(ALMANACK_ROOT)/web +ALMANACK_ROOT := $(ALMANACK_ROOT) + +# Define the destination for rsync +DEST := boat:/var/local/www/www.almnck.com/ + +# Define the rsync options +RSYNC_OPTS := -avz --delete + +# Define the default target, so it does nothing if just 'make' is run +.PHONY: default +default: + @echo "Please specify a target to run, e.g., 'make live' for live deployment." + +# Define the 'live' target which will be triggered on 'make live' +.PHONY: live +live: +ifndef ALMANACK_ROOT + $(error ALMANACK_ROOT is undefined. Please export it before running 'make live'.) +endif + @rsync $(RSYNC_OPTS) $(SRC_DIR) $(DEST) diff --git a/bin/activate-all b/bin/activate-all index ca3e971..ae79a4d 100755 --- a/bin/activate-all +++ b/bin/activate-all @@ -14,7 +14,8 @@ else echo "Unsupported shell." exit 1 fi -ALMANACK_ROOT=$(dirname $script_dir) + +declare -x ALMANACK_ROOT=$(dirname $script_dir) # Check for the existence of the venv directory if [ ! -d "$ALMANACK_ROOT/venv" ]; then diff --git a/web/Caddyfile b/web/Caddyfile new file mode 100644 index 0000000..10545a7 --- /dev/null +++ b/web/Caddyfile @@ -0,0 +1,8 @@ +almnck.com:80 { + redir https://www.almnck.com{uri} +} + +www.almnck.com:80 { + root * /usr/share/caddy/static + file_server +} diff --git a/web/static/index.html b/web/static/index.html new file mode 100644 index 0000000..619a939 --- /dev/null +++ b/web/static/index.html @@ -0,0 +1,7 @@ + +
+ + +