-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
59 lines (50 loc) · 2.54 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
51
52
53
54
55
56
57
58
help:
@echo "QGIS Planet Website"
@echo
@echo "Brought to you by Kartoza (Pty) Ltd."
@echo
@echo "Help for using this Makefile"
@echo
@echo "For detailed help please visit:"
@echo "https://github.com/QGIS/QGIS-Planet-Website"
@echo
@echo "------------------------------------------------------------------"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m - %s\n", $$1, $$2}'
# ----------------------------------------------------------------------------
# P R O D U C T I O N C O M M A N D S
# ----------------------------------------------------------------------------
build: ## Build the site for nocache.qgis.org, www.qgis.org and qgis.org
@echo
@echo "------------------------------------------------------------------"
@echo "Building site in production"
@echo "------------------------------------------------------------------"
sh ./scripts/get_commit_hash.sh
hugo --config config.toml,config/config.prod.toml
deploy: ## Deploy the site for nocache.qgis.org, www.qgis.org and qgis.org
@echo
@echo "------------------------------------------------------------------"
@echo "Deploy site in production"
@echo "------------------------------------------------------------------"
git pull && rm -rf archive; mkdir archive; mv public archive; make build
revert-deploy: ## Revert the site for nocache.qgis.org, www.qgis.org and qgis.org
@echo
@echo "------------------------------------------------------------------"
@echo "Revert to the previous state in production"
@echo "------------------------------------------------------------------"
rm -rf public; cp -r archive/public ./
# ----------------------------------------------------------------------------
# D E V E L O P M E N T C O M M A N D S
# ----------------------------------------------------------------------------
hugo-dev-build: ## Build the site locally and run a python server at localhost:8000 with hugo
@echo
@echo "------------------------------------------------------------------"
@echo "Building site in development"
@echo "------------------------------------------------------------------"
hugo --config config.toml,config/config.dev.toml
python3 -m http.server 8000 -d public_dev
hugo-run-dev: ## Run the server at localhost:1313 with hugo
@echo
@echo "------------------------------------------------------------------"
@echo "Building site in development"
@echo "------------------------------------------------------------------"
hugo server --config config.toml,config/config.dev.toml