2021-03-05 19:10:14 +01:00
|
|
|
.PHONY: help
|
|
|
|
help: # @HELP Print this message
|
2019-06-20 12:57:36 +02:00
|
|
|
help:
|
2021-03-05 19:10:14 +01:00
|
|
|
@echo "TARGETS:"
|
|
|
|
@grep -E '^.*: *# *@HELP' $(MAKEFILE_LIST) \
|
|
|
|
| awk ' \
|
|
|
|
BEGIN {FS = ": *# *@HELP"}; \
|
|
|
|
{ printf " %-20s %s\n", $$1, $$2 }; \
|
|
|
|
'
|
2019-06-20 12:57:36 +02:00
|
|
|
|
2021-03-05 19:10:14 +01:00
|
|
|
.PHONY: setup
|
|
|
|
setup: # @HELP Build the development containers and install dependencies
|
2020-01-07 10:54:51 +01:00
|
|
|
setup: dev-build update
|
2019-10-02 14:29:34 +02:00
|
|
|
|
2021-03-05 19:10:14 +01:00
|
|
|
.PHONY: dev-build
|
|
|
|
dev-build: # @HELP Build the development containers
|
2019-10-02 14:29:34 +02:00
|
|
|
dev-build:
|
2019-06-20 12:57:36 +02:00
|
|
|
@docker-compose build
|
2019-10-02 14:29:34 +02:00
|
|
|
|
2021-03-05 19:10:14 +01:00
|
|
|
.PHONY: update
|
|
|
|
update: # @HELP Install Python dependencies
|
2019-10-02 14:29:34 +02:00
|
|
|
update:
|
|
|
|
@echo "Installing / updating dependencies ..."
|
|
|
|
@docker-compose run homepage pip install --user -r requirements.txt
|
2020-01-07 10:54:51 +01:00
|
|
|
@echo "Successfully built containers and installed dependencies."
|
2019-10-02 14:29:34 +02:00
|
|
|
|
2021-03-05 19:10:14 +01:00
|
|
|
.PHONY: up
|
|
|
|
up: # @HELP Start the dev server
|
|
|
|
up:
|
|
|
|
@docker-compose up
|
|
|
|
|
2020-06-25 09:17:44 +02:00
|
|
|
KEYBASE_FILE ?= keybase.txt
|
2019-09-29 16:08:41 +02:00
|
|
|
ROBOTS_FILE ?= robots.txt.staging
|
2021-04-16 09:54:41 +02:00
|
|
|
ANALYTICSTXT_FILE ?= analytics.txt
|
|
|
|
SECURITYTXT_FILE ?= security.txt
|
2019-10-10 10:00:02 +02:00
|
|
|
SITEURL ?= http://localhost:8000
|
2019-09-11 12:44:51 +02:00
|
|
|
|
2021-03-05 19:10:14 +01:00
|
|
|
.PHONY: build
|
|
|
|
build: # @HELP Build the production assets
|
2019-09-05 11:18:42 +02:00
|
|
|
build:
|
2020-01-08 15:58:59 +01:00
|
|
|
@docker build --build-arg siteurl=${SITEURL} --build-arg offenaccountid=${OFFEN_ACCOUNT_ID} -t offen/website -f build/Dockerfile .
|
2020-01-07 10:54:51 +01:00
|
|
|
@rm -rf output && mkdir output
|
|
|
|
@docker create --entrypoint=bash -it --name assets offen/website
|
|
|
|
@docker cp assets:/code/homepage/output/. ./output/
|
|
|
|
@cp build/${ROBOTS_FILE} ./output/robots.txt
|
2020-06-25 09:17:44 +02:00
|
|
|
@cp build/${KEYBASE_FILE} ./output/keybase.txt
|
2021-04-16 09:54:41 +02:00
|
|
|
@mkdir -p ./output/.well-known
|
|
|
|
@cp build/${ANALYTICSTXT_FILE} ./output/.well-known/analytics.txt
|
|
|
|
@cp build/${SECURITYTXT_FILE} ./output/.well-known/security.txt
|
2020-01-07 10:54:51 +01:00
|
|
|
@docker rm assets
|