0c7e891396
- fix boo#1208752 - adjust packaging to build webassets locally, outside of OBS * to get the UI working, newer versions of prometheus need the react app assets * as running `npm install` inside of OBS is not possible, the required dependencies need to be prepared outside of OBS * added a PACKAGING_README.md file, that explains how the new web-ui-*.tar.gz and npm_licenses.tar.bz2 tarballs can be created - update to 2.42.0: OBS-URL: https://build.opensuse.org/request/show/1068670 OBS-URL: https://build.opensuse.org/package/show/server:monitoring/golang-github-prometheus-prometheus?expand=0&rev=64
31 lines
869 B
Makefile
31 lines
869 B
Makefile
NAME = prometheus
|
|
SPEC = golang-github-prometheus-prometheus.spec
|
|
|
|
default: clean tar
|
|
|
|
clean:
|
|
rm -f $(NAME)-*.tar $(NAME)-*.tar.gz
|
|
|
|
tar:
|
|
osc service disabledrun
|
|
@version=$$( awk '/^Version:/ {print $$2;exit;}' $(SPEC) ) && \
|
|
echo "Package version is $$version" && \
|
|
basename=$(NAME)-$$version && \
|
|
tar=$$basename.tar && \
|
|
web_ui=web-ui-$$version.tar && \
|
|
wd=$$(pwd) && \
|
|
tmpdir=$$(mktemp -d -p /tmp) && \
|
|
cd $$tmpdir && \
|
|
tar -zxf $$wd/$$tar.gz && \
|
|
cd $$basename && \
|
|
make assets npm_licenses assets-compress && \
|
|
tar -cf $$wd/$$web_ui web/ui/static/react && \
|
|
find web/ui/static -type f -name '*.gz' -exec tar -rf $$wd/$$web_ui "{}" \; && \
|
|
tar -rf $$wd/$$web_ui web/ui/embed.go && \
|
|
cd .. && \
|
|
echo "Creating web assets tarball" && \
|
|
mv $$basename/npm_licenses.tar.bz2 $$wd && \
|
|
cd $$wd && \
|
|
gzip -f $$web_ui && \
|
|
rm -rf $$tmpdir
|