aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2024-07-01 13:45:55 +0200
committerEgor Tensin <egor@tensin.name>2024-07-01 13:45:55 +0200
commit88a9ea11792a740f992ff0c49406b8296efdb22a (patch)
treeea8842aa5292cc86a3643ff981b75867efc7f70a
parentbump dependencies (diff)
downloadegor-tensin.github.io-88a9ea11792a740f992ff0c49406b8296efdb22a.tar.gz
egor-tensin.github.io-88a9ea11792a740f992ff0c49406b8296efdb22a.zip
Makefile: add maintenance alias
Diffstat (limited to '')
-rw-r--r--DEVELOPMENT.md8
-rw-r--r--Makefile19
2 files changed, 26 insertions, 1 deletions
diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md
index 73644ac..8ebd6cb 100644
--- a/DEVELOPMENT.md
+++ b/DEVELOPMENT.md
@@ -31,7 +31,13 @@ Development
Upgrading dependencies
----------------------
- bundle update
+* To upgrade dependencies in Gemfile.lock & push them to the repository:
+
+ make maintenance
+
+* Manually upgrade dependencies in Gemfile.lock:
+
+ bundle update
Building static pages
---------------------
diff --git a/Makefile b/Makefile
index ee6a446..da925bb 100644
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,25 @@ ruby:
deps: ruby
bundle install
+.PHONY: maintenance
+maintenance: ruby
+ bundle update
+ @git_status="$$( git status --porcelain=v1 )" && \
+ file_statuses="$$( echo "$$git_status" | cut -c 1-2 | sort -u )" && \
+ file_names="$$( echo "$$git_status" | cut -c 4- | grep -o '[^/]*$$' | sort -u )" && \
+ if [ -z "$$git_status" ]; then \
+ true ; \
+ elif [ "$$file_statuses $$file_names" = ' M Gemfile.lock' ]; then \
+ git commit -am 'bump dependencies' && \
+ git push -q ; \
+ else \
+ echo ; \
+ echo '-----------------------------------------------------------------'; \
+ echo 'Error: unrecognized modifications in the repository'; \
+ echo '-----------------------------------------------------------------'; \
+ exit 1; \
+ fi
+
jekyll := bundle exec jekyll
.PHONY: build