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
This commit is contained in:
Martin Pitt 2021-09-02 15:59:29 +02:00 committed by Katerina Koukiou
parent 94194c5187
commit 26be6c8540

View file

@ -6,6 +6,7 @@ TEST_OS = centos-8-stream
endif endif
export TEST_OS export TEST_OS
TARFILE=cockpit-$(PACKAGE_NAME)-$(VERSION).tar.gz 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 RPMFILE=$(shell rpmspec -D"VERSION $(VERSION)" -q cockpit-$(PACKAGE_NAME).spec.in).rpm
VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS) VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS)
# stamp file to check if/when npm install ran # 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 \ --exclude cockpit-$(PACKAGE_NAME).spec.in --exclude node_modules \
$$(git ls-files) $(LIB_TEST) src/lib package-lock.json cockpit-$(PACKAGE_NAME).spec dist/ $$(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 srpm: $(TARFILE) cockpit-$(PACKAGE_NAME).spec
rpmbuild -bs \ rpmbuild -bs \
--define "_sourcedir `pwd`" \ --define "_sourcedir `pwd`" \
@ -164,4 +170,4 @@ $(NODE_MODULES_TEST): package.json
env -u NODE_ENV npm install env -u NODE_ENV npm install
env -u NODE_ENV npm prune 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