mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-05 13:23:17 +00:00
a5fc982ea5
v2.14 introduced a new experimental React UI and changed how web assets are bundled with Prometheus. A separate pre-build command is required to generate an asset bundle that gets statically linked into the Prometheus binary.
21 lines
695 B
Bash
Executable File
21 lines
695 B
Bash
Executable File
#!/usr/bin/env nix-shell
|
|
#!nix-shell -I nixpkgs=../../../.. -i bash -p wget yarn2nix-moretea.yarn2nix
|
|
|
|
# This script is based upon:
|
|
# pkgs/applications/networking/instant-messengers/riot/update-riot-desktop.sh
|
|
|
|
set -euo pipefail
|
|
|
|
if [ "$#" -ne 1 ] || [[ "$1" == -* ]]; then
|
|
echo "Regenerates the Yarn dependency lock files for the prometheus package."
|
|
echo "Usage: $0 <git release tag>"
|
|
exit 1
|
|
fi
|
|
|
|
PROM_WEB_SRC="https://raw.githubusercontent.com/prometheus/prometheus/$1"
|
|
|
|
wget "$PROM_WEB_SRC/web/ui/react-app/package.json" -O webui-package.json
|
|
wget "$PROM_WEB_SRC/web/ui/react-app/yarn.lock" -O yarn.lock
|
|
yarn2nix --lockfile=yarn.lock > webui-yarndeps.nix
|
|
rm yarn.lock
|