forked from photoprism/photoprism-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (56 loc) · 1.66 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
59
60
.PHONY: all deps fix pip build serve install replace upgrade venv install-venv upgrade upgrade-venv replace replace-venv reinstall watch deploy;
UID := $(shell id -u)
GID := $(shell id -g)
export VIRTUAL_ENV := $(abspath "./venv")
export VIRTUAL_ENV_BIN := $(abspath "./venv/bin")
export PATH := $(VIRTUAL_ENV_BIN):$(PATH)
-include .env
export
all: deploy
deps: pip upgrade
install: install-venv
upgrade: remove-venv install-venv
replace: upgrade
watch: serve
fix:
sudo chown -R $(UID):$(GID) .
sudo chmod -R a+rwX .
pip:
sudo apt-get install -y git python3 python3-pip python3-venv python3-wheel
venv: install-venv
remove-venv:
rm -rf ./venv
install-venv:
python3 -m venv venv
. ./venv/bin/activate
pip3 install wheel
ifdef GH_TOKEN
@echo "Found GH_TOKEN, installing mkdocs-material-insiders"
pip3 install --disable-pip-version-check git+https://${GH_TOKEN}@github.com/photoprism/mkdocs-material-insiders.git
else
@echo "GH_TOKEN not set in .env file, installing regular mkdocs-material"
pip3 install --disable-pip-version-check mkdocs-material
endif
pip3 install --disable-pip-version-check -r requirements.txt
serve:
mkdocs serve -a 0.0.0.0:8000
build:
mkdocs build --config-file mkdocs.deploy.yml
deploy:
mkdocs gh-deploy --force --config-file mkdocs.deploy.yml
pull:
git checkout master
git pull origin master
push:
git checkout master
git push origin master
img-resize:
mogrify -resize '1000x860>' docs/user-guide/img/*.jpg
mogrify -resize '1000x860>' docs/user-guide/**/img/*.jpg
mogrify -resize '1000x860>' docs/getting-started/nas/img/asustor/*.jpg
merge:
git checkout deploy
git pull origin deploy
git merge master
git push origin deploy
git checkout master