Makefile 1.48 KB
Newer Older
1 2 3 4 5 6 7
# ===============
# local webserver
# ===============
webserver:
	cd htdocs; python -m SimpleHTTPServer 8001; cd ..


8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
# ===========
# bumpversion
# ===========

$(eval venvpath     := .venv27)
$(eval bumpversion  := $(venvpath)/bin/bumpversion)

virtualenv:
	@test -e $(venvpath)/bin/python || `command -v virtualenv` --python=`command -v python` --no-site-packages $(venvpath)

bumpversion: virtualenv
	@$(venvpath)/bin/pip install bumpversion
	$(bumpversion) $(bump)


# =======
# release
# =======

push:
	git push && git push --tags
29
	git push lqdn && git push lqdn --tags
30 31 32 33 34


release: bumpversion push


35 36 37 38 39 40 41 42
# =======
# upgrade
# =======

upgrade:
	git stash save
	git pull
	git stash pop
43
	yarn install
44 45 46
	yarn run release


47 48 49 50 51 52 53
# ======
# 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/
54
ptrace_target := root@ptrace.gafam.info:/srv/www/organizations/gafam/ptrace.gafam.info/htdocs/
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
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