mirror of
https://github.com/45Drives/cockpit-navigator.git
synced 2025-07-31 01:24:37 +02:00
update automatic makefile
This commit is contained in:
parent
75df808dad
commit
a2a9863ac1
24
Makefile
24
Makefile
@ -75,7 +75,7 @@ $(VERSION_FILES): ./manifest.json
|
|||||||
|
|
||||||
# build outputs
|
# build outputs
|
||||||
.SECONDEXPANSION:
|
.SECONDEXPANSION:
|
||||||
$(OUTPUTS): %/dist/index.html: $$(shell find $$*/src -type f -not -name *.test.js) $$(shell find $$*/public -type f) $$(shell find $$* -name 'yarn.lock' -o -name 'package.json' -not -path '*node_modules*') $$*/*.html $$*/*.js
|
$(OUTPUTS): %/dist/index.html: $$(shell find '$$*' -type d \( -name node_modules -o -path '$$*/dist' -o -path '*node_modules*' \) -prune -o -type f -not \( -name .gitignore \) -print)
|
||||||
@echo -e $(call cyantext,Building $*)
|
@echo -e $(call cyantext,Building $*)
|
||||||
$(NPM_PREFIX) $* install
|
$(NPM_PREFIX) $* install
|
||||||
ifeq ($(AUTO_UPGRADE_DEPS),1)
|
ifeq ($(AUTO_UPGRADE_DEPS),1)
|
||||||
@ -88,7 +88,7 @@ endif
|
|||||||
# system install, requires `systemctl restart cockpit.socket`
|
# system install, requires `systemctl restart cockpit.socket`
|
||||||
# runs plugin-install-* for each plugin
|
# runs plugin-install-* for each plugin
|
||||||
.SECONDEXPANSION:
|
.SECONDEXPANSION:
|
||||||
install install-local install-remote: default $$(addprefix plugin-$$@-, $$(PLUGIN_SRCS))
|
install install-local install-remote: $$(OUTPUTS) $$(addprefix plugin-$$@-, $$(PLUGIN_SRCS)) system-files-$$@
|
||||||
ifeq ($(RESTART_COCKPIT), 1)
|
ifeq ($(RESTART_COCKPIT), 1)
|
||||||
ifndef DESTDIR
|
ifndef DESTDIR
|
||||||
$(SSH) systemctl stop cockpit.socket
|
$(SSH) systemctl stop cockpit.socket
|
||||||
@ -120,11 +120,23 @@ plugin-install-remote-% : INSTALL_SUFFIX=-test
|
|||||||
plugin-install-remote-% : SSH=ssh $(REMOTE_TEST_USER)@$(REMOTE_TEST_HOST)
|
plugin-install-remote-% : SSH=ssh $(REMOTE_TEST_USER)@$(REMOTE_TEST_HOST)
|
||||||
plugin-install-remote-% : REMOTE_TEST_HOME=$(shell ssh $(REMOTE_TEST_USER)@$(REMOTE_TEST_HOST) 'echo $$HOME')
|
plugin-install-remote-% : REMOTE_TEST_HOME=$(shell ssh $(REMOTE_TEST_USER)@$(REMOTE_TEST_HOST) 'echo $$HOME')
|
||||||
|
|
||||||
.SECONDEXPANSION:
|
system-files-install:
|
||||||
test: $$(addprefix test-, $$(PLUGIN_SRCS))
|
-cp -af system_files/* $(DESTDIR)/
|
||||||
|
|
||||||
test-%:
|
system-files-install-local:
|
||||||
$(NPM_PREFIX) $* test
|
-cp -af system_files/* $(DESTDIR)/
|
||||||
|
|
||||||
|
system-files-install-remote:
|
||||||
|
-rsync -avh system_files/* $(REMOTE_TEST_USER)@$(REMOTE_TEST_HOST):$(DESTDIR)/
|
||||||
|
|
||||||
|
package-generic: default
|
||||||
|
PKG_NAME="$$(jq -r '[ .name, .version ] | join("_")' ./manifest.json)"'_generic' && \
|
||||||
|
rm -f "$${PKG_NAME}.{zip,tar.gz}" && \
|
||||||
|
ln -snf . "$${PKG_NAME}" && \
|
||||||
|
readarray -t FILES < <(find -H "$${PKG_NAME}" -type d \( -name 'src' -o -name 'node_modules' \) -prune -o -type f \( -path '*/dist/*' -o -path '*/system_files/*' -o -name package.json -o -iname 'makefile' -o -iname 'licen[sc]e' -o -iname 'readme.md' -o -name 'manifest.json' \) -print) && \
|
||||||
|
zip -q "$${PKG_NAME}.zip" "$${FILES[@]}" && \
|
||||||
|
tar -czf "$${PKG_NAME}.tar.gz" "$${FILES[@]}" && \
|
||||||
|
rm "$${PKG_NAME}"
|
||||||
|
|
||||||
clean: FORCE
|
clean: FORCE
|
||||||
rm $(dir $(OUTPUTS)) -rf
|
rm $(dir $(OUTPUTS)) -rf
|
||||||
|
Loading…
x
Reference in New Issue
Block a user