Browse Source

Store compiled web ui in CI (#10546)

Some downstream distros fail to compile Prometheus UI (Debian, NixOS).

This is an attempt to store compiled UI in circleci for them to consume
it. Currently we do not expose this outside of circleci.

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>

Co-authored-by: Julien Pivotto <roidelapluie@o11y.eu>
pull/10550/head
Julien Pivotto 3 years ago committed by GitHub
parent
commit
a236166c71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      .circleci/config.yml
  2. 7
      Makefile
  3. 8
      scripts/package_assets.sh

3
.circleci/config.yml

@ -62,6 +62,9 @@ jobs:
- run: make ui-lint
- run: make ui-build-module
- run: make ui-test
- run: make assets-tarball -o assets
- store_artifacts:
path: web/ui/static.tar.gz
- save_cache:
key: v3-npm-deps-{{ checksum "web/ui/package-lock.json" }}
paths:

7
Makefile

@ -63,10 +63,15 @@ ui-lint:
assets: ui-install ui-build
.PHONY: assets-compress
assets-compress:
assets-compress: assets
@echo '>> compressing assets'
scripts/compress_assets.sh
.PHONY: assets-tarball
assets-tarball: assets-compress
@echo '>> packaging assets'
scripts/package_assets.sh
.PHONY: test
# If we only want to only test go code we have to change the test target
# which is called by all.

8
scripts/package_assets.sh

@ -0,0 +1,8 @@
#!/usr/bin/env bash
#
# compress static assets
set -euo pipefail
cd web/ui
find static -type f -name '*.gz' -print0 | xargs -0 tar cf static.tar.gz
Loading…
Cancel
Save