From 26be6c8540244c42bb5c48d2bd5563c645bb0fee Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Thu, 2 Sep 2021 15:59:29 +0200 Subject: [PATCH] Add a `make node-cache` The node_modules cache tarball will be published as release artifact, to make sure that any release can be rebuilt in a reproducible way. Cockpituous' release-source will call this if available: https://github.com/cockpit-project/cockpituous/pull/438 --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 68b904a..48a8c69 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ TEST_OS = centos-8-stream endif export TEST_OS TARFILE=cockpit-$(PACKAGE_NAME)-$(VERSION).tar.gz +NODE_CACHE=cockpit-$(PACKAGE_NAME)-node-$(VERSION).tar.xz RPMFILE=$(shell rpmspec -D"VERSION $(VERSION)" -q cockpit-$(PACKAGE_NAME).spec.in).rpm VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS) # stamp file to check if/when npm install ran @@ -94,6 +95,11 @@ $(TARFILE): $(WEBPACK_TEST) cockpit-$(PACKAGE_NAME).spec --exclude cockpit-$(PACKAGE_NAME).spec.in --exclude node_modules \ $$(git ls-files) $(LIB_TEST) src/lib package-lock.json cockpit-$(PACKAGE_NAME).spec dist/ +$(NODE_CACHE): $(NODE_MODULES_TEST) + tar --xz -cf $@ node_modules + +node-cache: $(NODE_CACHE) + srpm: $(TARFILE) cockpit-$(PACKAGE_NAME).spec rpmbuild -bs \ --define "_sourcedir `pwd`" \ @@ -164,4 +170,4 @@ $(NODE_MODULES_TEST): package.json env -u NODE_ENV npm install env -u NODE_ENV npm prune -.PHONY: all clean install devel-install print-version dist-gzip srpm rpm check vm update-po +.PHONY: all clean install devel-install print-version dist-gzip node-cache srpm rpm check vm update-po