diff options
-rw-r--r-- | DEVELOPMENT.md | 3 | ||||
-rw-r--r-- | Makefile | 19 |
2 files changed, 21 insertions, 1 deletions
diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 2641a1a..3fd937b 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -49,7 +49,8 @@ another user, it could get used instead). Upgrading dependencies ---------------------- -* Upgrade virtual environment packages: `make venv/upgrade` +* Upgrade virtual environment packages: `make venv/upgrade`. +`make maintenance` does that and pushes a commit to the upstream. * Upgrade base Docker images. * Find the current base images using `git grep -P 'FROM \w+:'` * Upgrade the [cmark-gfm] version used in the [cgitize-frontend Docker image]. @@ -23,6 +23,25 @@ venv/upgrade: venv/reset && pip uninstall -q --yes '$(call escape,$(PROJECT))' \ && pip freeze > requirements.txt +.PHONY: maintenance +maintenance: + $(MAKE) venv/upgrade + + @git_status="$$( git status --porcelain=v1 )" && \ + if [ -z "$$git_status" ]; then \ + true; \ + elif [ "$$git_status" = ' M requirements.txt' ]; then \ + git commit -am 'requirements.txt: bump dependencies' && \ + git push -q; \ + else \ + echo; \ + echo '-----------------------------------------------------------------'; \ + echo 'Error: unrecognized modifications in the repository:'; \ + echo "$$git_status"; \ + echo '-----------------------------------------------------------------'; \ + exit 1; \ + fi + .PHONY: python python: $(venv_activate) && python |