Skip to content

Commit

Permalink
Package and ship frontend independenlty (prometheus#2893)
Browse files Browse the repository at this point in the history
Enable frontend consumption by downstreams, like debian and nixos

Signed-off-by: Julien Pivotto <[email protected]>
  • Loading branch information
roidelapluie authored Apr 22, 2022
1 parent 71d61c9 commit 74ebd3d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ jobs:
- run: git diff --exit-code
- store_test_results:
path: ~/test-results
- run:
name: Save assets
command: make assets-tarball
- persist_to_workspace:
root: .
paths:
- .tarballs
test:
docker:
# Whenever the Go version is updated here, .promu.yml should also be updated.
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ build-all: assets apiv2 build
.PHONY: assets
assets: asset/assets_vfsdata.go

.PHONY: assets-tarball
assets-tarball: ui/app/script.js ui/app/index.html
scripts/package_assets.sh

asset/assets_vfsdata.go: ui/app/script.js ui/app/index.html ui/app/lib template/default.tmpl template/email.tmpl
GO111MODULE=$(GO111MODULE) $(GO) generate $(GOOPTS) ./asset
@$(GOFMT) -w ./asset
Expand Down
9 changes: 9 additions & 0 deletions scripts/package_assets.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
#
# compress static assets

set -euo pipefail

version="$(< VERSION)"
mkdir -p .tarballs
tar czf .tarballs/alertmanager-web-ui-${version}.tar.gz ui/app/script.js ui/app/index.html

0 comments on commit 74ebd3d

Please sign in to comment.