Makefile: add Makefile for building and installing cockpit plugin

Add some targets to the Makefile so we can install the on-prem frontend
as a cockpit plugin. based on starter-kit project
This commit is contained in:
Michal Gold 2024-10-15 10:58:39 +03:00 committed by Lucas Garfield
parent 41cdc7d553
commit 28ba4af814
3 changed files with 24 additions and 0 deletions

6
.gitignore vendored
View file

@ -23,7 +23,13 @@ yarn-error.log*
coverage
*~
*.swp
bots
# madge graph of dependencies generated by `npm run circular:graph`
deps.png
# build directories
cockpit/public/vendor*
cockpit/public/src_*
cockpit/public/main*

View file

@ -1,4 +1,5 @@
FISTBOOT_SERVICE := $(shell base64 -w0 < aux/custom-first-boot.service)
INSTALL_DIR := ~/.local/share/cockpit/image-builder-frontend
help:
@cat Makefiles
@ -14,3 +15,19 @@ install:
start: prep
npm start
cockpit/all: devel-uninstall devel-install build
devel-install:
mkdir -p ~/.local/share/cockpit
ln -s $(shell pwd)/cockpit/public $(INSTALL_DIR)
build:
npm run build:cockpit
devel-uninstall:
rm -rf $(INSTALL_DIR)
rm cockpit/public/*.css
rm cockpit/public/*.js
.PHONY: cockpit/all devel-install build devel-uninstall

View file

@ -99,6 +99,7 @@
"test:watch": "TZ=UTC vitest",
"test:coverage": "TZ=UTC vitest run --coverage",
"build": "fec build",
"build:cockpit": "webpack --config cockpit/webpack.config.ts",
"api": "npm-run-all api:pull api:generate",
"api:generate": "bash api/codegen.sh",
"api:pull": "bash api/pull.sh",