-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
50 lines (44 loc) · 1.56 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
.PHONY: help
help: # @HELP Print this message
help:
@echo "TARGETS:"
@grep -E '^.*: *# *@HELP' $(MAKEFILE_LIST) \
| awk ' \
BEGIN {FS = ": *# *@HELP"}; \
{ printf " %-20s %s\n", $$1, $$2 }; \
'
.PHONY: setup
setup: # @HELP Build the development containers and install dependencies
setup: dev-build update
.PHONY: dev-build
dev-build: # @HELP Build the development containers
dev-build:
@docker-compose build
.PHONY: update
update: # @HELP Install Python dependencies
update:
@echo "Installing / updating dependencies ..."
@docker-compose run homepage pip install --user -r requirements.txt
@echo "Successfully built containers and installed dependencies."
.PHONY: up
up: # @HELP Start the dev server
up:
@docker-compose up
KEYBASE_FILE ?= keybase.txt
ROBOTS_FILE ?= robots.txt.staging
ANALYTICSTXT_FILE ?= analytics.txt
SECURITYTXT_FILE ?= security.txt
SITEURL ?= http://localhost:8000
.PHONY: build
build: # @HELP Build the production assets
build:
@docker build --build-arg siteurl=${SITEURL} --build-arg offenaccountid=${OFFEN_ACCOUNT_ID} -t offen/website -f build/Dockerfile .
@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
@cp build/${KEYBASE_FILE} ./output/keybase.txt
@mkdir -p ./output/.well-known
@cp build/${ANALYTICSTXT_FILE} ./output/.well-known/analytics.txt
@cp build/${SECURITYTXT_FILE} ./output/.well-known/security.txt
@docker rm assets