-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
58 lines (54 loc) · 1.65 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
.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
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
./venv/bin/pip3 install wheel
ifdef GH_TOKEN
@echo "Found GH_TOKEN, installing mkdocs-material-insiders"
./venv/bin/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"
./venv/bin/pip3 install --disable-pip-version-check mkdocs-material
endif
./venv/bin/pip3 install --disable-pip-version-check -r requirements.txt
serve:
./venv/bin/mkdocs serve -a 0.0.0.0:8000
build:
./venv/bin/mkdocs build --config-file mkdocs.deploy.yml
deploy:
./venv/bin/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
merge:
git checkout deploy
git pull origin deploy
git merge master
git push origin deploy
git checkout master
img-resize:
mogrify -resize '1000x860>' docs/user-guide/img/*.jpg
mogrify -resize '1000x860>' docs/user-guide/**/img/*.jpg