2024-02-01 12:50:12 +00:00
|
|
|
# flexible use with docker and podman
|
|
|
|
platform ?= docker
|
|
|
|
|
2023-08-08 21:11:00 +00:00
|
|
|
.PHONY: build
|
|
|
|
build:
|
|
|
|
# Build Docker image
|
2024-02-01 12:50:12 +00:00
|
|
|
$(platform) build -t milksad-website .
|
2023-08-08 21:11:00 +00:00
|
|
|
|
|
|
|
.PHONY: fullclean
|
|
|
|
fullclean: clean
|
2024-02-01 12:50:12 +00:00
|
|
|
$(platform) rmi milksad-website-builder -f
|
|
|
|
$(platform) image prune --filter label=stage=milksad-website-builder
|
2023-08-08 21:11:00 +00:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2024-02-01 12:50:12 +00:00
|
|
|
rm -r site_export
|
|
|
|
|
|
|
|
site_export: build
|
|
|
|
rm -rf site_export
|
|
|
|
mkdir -p site_export
|
|
|
|
$(platform) run milksad-website tar c -C /home/_site . | tar x -C site_export
|
2023-08-08 21:11:00 +00:00
|
|
|
|
2024-02-01 12:50:12 +00:00
|
|
|
#.PHONY: serve
|
|
|
|
#serve: build
|
|
|
|
# # Run Docker container with listener for current dir and port mapping
|
|
|
|
# $(platform) run --rm -p 0.0.0.0:4000:80 -it milksad-website
|
2023-08-08 21:11:00 +00:00
|
|
|
|
2024-02-01 12:50:12 +00:00
|
|
|
upload: site_export
|
|
|
|
rsync -av --delete site_export/ milksad-website:/var/www/html
|
2023-08-08 21:11:00 +00:00
|
|
|
|
|
|
|
.PHONY: build-dev
|
|
|
|
build-dev:
|
|
|
|
# Build Docker image
|
2024-02-01 12:50:12 +00:00
|
|
|
$(platform) build --target builder -t dev-milksad-website .
|
2023-08-08 21:11:00 +00:00
|
|
|
|
|
|
|
.PHONY: dev
|
|
|
|
dev: build-dev
|
2024-02-01 12:50:12 +00:00
|
|
|
$(platform) run --rm --expose 4000 -p 127.0.0.1:4000:4000 -v ${PWD}:/home -it dev-milksad-website jekyll serve -H 0.0.0.0
|
|
|
|
|
|
|
|
.PHONY: dev-shell
|
|
|
|
dev-shell: build-dev
|
|
|
|
$(platform) run --rm --expose 4000 -p 127.0.0.1:4000:4000 -v ${PWD}:/home -it dev-milksad-website sh
|