-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
76 lines (56 loc) · 1.48 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# ===============
# local webserver
# ===============
webserver:
cd htdocs; python3 -m http.server 8001; cd ..
# ===========
# bumpversion
# ===========
$(eval venvpath := .venv)
$(eval pip := $(venvpath)/bin/pip)
$(eval python := $(venvpath)/bin/python)
$(eval bumpversion := $(venvpath)/bin/bump2version)
virtualenv:
@test -e $(python) || python3 -m venv $(venvpath)
bumpversion: virtualenv
@$(pip) install bump2version
$(bumpversion) $(bump)
# =======
# release
# =======
push:
git push && git push --tags
git push lqdn && git push lqdn --tags
release: bumpversion push
# =======
# upgrade
# =======
upgrade:
git stash save
git pull
git stash pop
yarn install
yarn run release
# ======
# ptrace
# ======
# Don't commit media assets (screenshots, other large files etc.) to the repository
# or send them using email or instant messaging.
# Instead, upload them to https://ptrace.gafam.info/
ptrace_target := [email protected]:/srv/www/organizations/gafam/ptrace.gafam.info/htdocs/
ptrace_http := https://ptrace.gafam.info/
ptrace: check-ptrace-options
$(eval prefix := $(shell date --iso-8601))
$(eval name := $(shell basename $(source)))
$(eval id := $(prefix)_$(name))
@# debugging
@#echo "name: $(name)"
@#echo "id: $(id)"
@scp '$(source)' '$(ptrace_target)$(id)'
$(eval url := $(ptrace_http)$(id))
@echo "Access URL: $(url)"
check-ptrace-options:
@if test "$(source)" = ""; then \
echo "ERROR: 'source' not set"; \
exit 1; \
fi