diff --git a/.circleci/config.yml b/.circleci/config.yml index 32d6f693..79bdb6f2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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. diff --git a/Makefile b/Makefile index 16db86c5..df11e27b 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/scripts/package_assets.sh b/scripts/package_assets.sh new file mode 100755 index 00000000..f9a62e39 --- /dev/null +++ b/scripts/package_assets.sh @@ -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