37 lines
950 B
Makefile
37 lines
950 B
Makefile
# Important directories
|
|
VUE_APP_DIR = shacl-vue
|
|
DIST_DIR = dist
|
|
|
|
all: build
|
|
|
|
# Install vite and shacl-vue dependencies
|
|
install:
|
|
npm install vite
|
|
cd $(VUE_APP_DIR) && npm install
|
|
|
|
# Build shacl-vue using top-level Vite-config
|
|
# Copy shacl-vue config to dist directory
|
|
build: clean
|
|
cd $(VUE_APP_DIR) && \
|
|
BUILD_GIT_COMMIT="$(shell git rev-parse HEAD)" \
|
|
BUILD_GIT_COMMIT_SHORT="$(shell git rev-parse --short HEAD)" \
|
|
BUILD_GIT_BRANCH="$(shell git rev-parse --abbrev-ref HEAD)" \
|
|
BUILD_GIT_DATE="$(shell git show -s --format=%cI HEAD)" \
|
|
npm run build:app
|
|
mv $(VUE_APP_DIR)/dist/app ./$(DIST_DIR)
|
|
cp config* $(DIST_DIR)/
|
|
cp favicon.ico $(DIST_DIR)/favicon.ico
|
|
cp *logo* $(DIST_DIR)/
|
|
cp *.html $(DIST_DIR)/
|
|
|
|
# Clean output
|
|
clean:
|
|
rm -rf $(DIST_DIR)
|
|
|
|
test: install build
|
|
npx serve $(DIST_DIR) -l 3000
|
|
|
|
deploy: dist
|
|
rsync -rvz --delete $</ herbert.trr379.de:/var/www/dfg-cp-survey.trr379.de/www/ui/
|
|
|
|
.PHONY: install build clean test deploy
|