aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2024-07-01 14:15:48 +0200
committerEgor Tensin <egor@tensin.name>2024-07-01 14:15:48 +0200
commitd00cfdbd06f403ec75a05da5e83c40c0ec598681 (patch)
tree6a54824b594b4101484a765feeec67b73de6389c
parentbump dependencies (diff)
downloadwireguard-config-d00cfdbd06f403ec75a05da5e83c40c0ec598681.tar.gz
wireguard-config-d00cfdbd06f403ec75a05da5e83c40c0ec598681.zip
Makefile: add maintenance alias
-rw-r--r--DEVELOPMENT.md16
-rw-r--r--Makefile24
2 files changed, 31 insertions, 9 deletions
diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md
index 1dc6ee2..4dba83f 100644
--- a/DEVELOPMENT.md
+++ b/DEVELOPMENT.md
@@ -31,15 +31,19 @@ Development
Upgrading dependencies
----------------------
-Ruby dependencies:
+* To upgrade Ruby & Node.js dependencies & push them to the repository:
- bundle update
+ make maintenance
-Node.js dependencies:
+* Manually upgrade Ruby dependencies:
- make npm
- npm update
- make bundle
+ bundle update
+
+* Manually upgrade Node.js dependencies:
+
+ make npm
+ npm update
+ make bundle
Building static pages
---------------------
diff --git a/Makefile b/Makefile
index cee4d9e..f0eea16 100644
--- a/Makefile
+++ b/Makefile
@@ -18,15 +18,33 @@ deps: ruby
npm:
npm install
-.PHONY: all-deps
-all-deps: deps npm
-
jekyll := bundle exec jekyll
.PHONY: build
build:
$(jekyll) build
+.PHONY: maintenance
+maintenance: ruby npm
+ bundle update
+ npm update
+ @$(MAKE) bundle
+
+ @git_status="$$( git status --porcelain=v1 )" && \
+ if [ -z "$$git_status" ]; then \
+ true ; \
+ elif [ "$$git_status" = $$' M Gemfile.lock\n M package-lock.json' ] \
+ || [ "$$git_status" = $$' M Gemfile.lock\n M package-lock.json\n M assets/js/bundle.js' ]; then \
+ git commit -am 'bump dependencies' && \
+ git push -q ; \
+ else \
+ echo ; \
+ echo '-----------------------------------------------------------------'; \
+ echo 'Error: unrecognized modifications in the repository'; \
+ echo '-----------------------------------------------------------------'; \
+ exit 1; \
+ fi
+
.PHONY: serve
serve:
ifeq ($(LIVE_RELOAD),1)