web: Add initial website, and script to copy it to live copy on boat
This commit is contained in:
parent
55589d995b
commit
a2105f6b09
4 changed files with 40 additions and 1 deletions
23
Makefile
Normal file
23
Makefile
Normal file
|
|
@ -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)
|
||||||
|
|
@ -14,7 +14,8 @@ else
|
||||||
echo "Unsupported shell."
|
echo "Unsupported shell."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
ALMANACK_ROOT=$(dirname $script_dir)
|
|
||||||
|
declare -x ALMANACK_ROOT=$(dirname $script_dir)
|
||||||
|
|
||||||
# Check for the existence of the venv directory
|
# Check for the existence of the venv directory
|
||||||
if [ ! -d "$ALMANACK_ROOT/venv" ]; then
|
if [ ! -d "$ALMANACK_ROOT/venv" ]; then
|
||||||
|
|
|
||||||
8
web/Caddyfile
Normal file
8
web/Caddyfile
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
almnck.com:80 {
|
||||||
|
redir https://www.almnck.com{uri}
|
||||||
|
}
|
||||||
|
|
||||||
|
www.almnck.com:80 {
|
||||||
|
root * /usr/share/caddy/static
|
||||||
|
file_server
|
||||||
|
}
|
||||||
7
web/static/index.html
Normal file
7
web/static/index.html
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Old Danny's Almanack</h1>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Loading…
Reference in a new issue