-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
33 lines (27 loc) · 914 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
VERSION ?= "main"
PYTHON ?= python3
PROGNAME = gdash
help:
@echo "make release - Create Single file Release"
build-ui:
cd ui && npm install && npm run build;
gen-version:
@echo "\"\"\"Version\"\"\"" > gdash/version.py
@echo "VERSION = \"${VERSION}\"" >> gdash/version.py
release: gen-version build-ui
@rm -rf build
@mkdir -p build/src
@cp -r gdash/* build/src/
@${PYTHON} -m pip install --system -r requirements.txt --target build/src
@cp -r ui/build build/src/ui
@cd build/src && zip -r ../${PROGNAME}.zip *
@echo '#!/usr/bin/env ${PYTHON}' | cat - build/${PROGNAME}.zip > build/${PROGNAME}
@chmod +x build/${PROGNAME}
@rm -rf build/src
@rm -f build/${PROGNAME}.zip
@echo "Single deployment file is ready: build/${PROGNAME}"
pypi-release: gen-version build-ui
@rm -rf gdash/ui
@mv ui/build gdash/ui
python3 setup.py sdist bdist_wheel
.PHONY: help release gen-version build-ui pypi-release