diff options
author | Peter Hoeg <peter@speartail.com> | 2017-02-24 22:51:17 +0800 |
---|---|---|
committer | Peter Hoeg <peter@speartail.com> | 2017-02-27 17:09:24 +0800 |
commit | b52fa7b6229535f15afcdbd521e32297aa76ec55 (patch) | |
tree | a7a59257fe5a6bedc39c1f5ea088176e27421a54 /pkgs/servers | |
parent | c013f9240e0d00def8d9390688f1bb14ae1ec5fd (diff) |
uchiwa: 0.21.1
Include script to upgrade.
Diffstat (limited to 'pkgs/servers')
-rw-r--r-- | pkgs/servers/monitoring/uchiwa/bower-packages.nix | 23 | ||||
-rw-r--r-- | pkgs/servers/monitoring/uchiwa/bower.json | 6 | ||||
-rw-r--r-- | pkgs/servers/monitoring/uchiwa/default.nix | 50 | ||||
-rw-r--r-- | pkgs/servers/monitoring/uchiwa/src.nix | 4 | ||||
-rwxr-xr-x | pkgs/servers/monitoring/uchiwa/update.sh | 31 |
5 files changed, 114 insertions, 0 deletions
diff --git a/pkgs/servers/monitoring/uchiwa/bower-packages.nix b/pkgs/servers/monitoring/uchiwa/bower-packages.nix new file mode 100644 index 000000000000..80e73d632357 --- /dev/null +++ b/pkgs/servers/monitoring/uchiwa/bower-packages.nix @@ -0,0 +1,23 @@ +# Generated by bower2nix v3.1.1 (https://github.com/rvl/bower2nix) +{ fetchbower, buildEnv }: +buildEnv { name = "bower-env"; ignoreCollisions = true; paths = [ + (fetchbower "uchiwa-web" "0.22.1" "0.22.1" "09rhssb5bpwdahdl2fxkjmax8cqg2m51bbf0m3lhkcrcjfc2w8kj") + (fetchbower "angular" "1.4.14" "~1.4" "1j5d80bxqh9lgcbmd661bsk8xrhnf43ym77jsk9n845gqr02bdkl") + (fetchbower "angular-bootstrap" "2.2.0" "~2.2.0" "0zbimxmrmgbz60xg5rnkhv4gd0zvp5fdjdx5407r6a942irfy2x7") + (fetchbower "angular-cookies" "1.4.14" "~1.4" "10z9azpd228jwdn8p767a93xhb5nrypwa0j6491kbcvm2q1k0g6a") + (fetchbower "angular-gravatar" "0.3.2" "~0.3.1" "17d2sc828dsnlkjc4b9irandpimqwan8hlvk9wlmlv8yiyi685p6") + (fetchbower "angular-mass-autocomplete-uchiwa" "0.4.1" "0.4.1" "1h2ypg35f6nd6gy6yznpiadql13lk1gyccq6qd4mvksbyb5va6l5") + (fetchbower "angular-moment" "0.9.2" "~0.9.0" "143vivplxqd03vg23ynad2yrlgn6dmad7avjmzh0ina2qx7zslgf") + (fetchbower "angular-resource" "1.4.14" "~1.4" "1ll2qd0kn39fl5aa49894n1bfcl8dgrfk0w154rkhg7k732q18bk") + (fetchbower "angular-route" "1.4.14" "~1.4" "0wfdgvvldgzf7c4lba3x8mw38l9zwkm0i9fg8ad7pvjkqz133sqs") + (fetchbower "angular-sanitize" "1.4.14" "~1.4" "072b8dcxjp4cjvcjqxsd0bxa8xd2nqvjb1v878qgfkhf0wz44x32") + (fetchbower "angular-toastr" "1.6.0" "1.6.0" "1yksx3a4c3cva5liq087z4j196p0vxp1mzhbr27qr9wmyy6z84z1") + (fetchbower "angular-ua-parser" "0.0.2" "0.0.2" "0z24747b0sywjyzl5chcwr96mpmyr595bry63c4d35mp186ail5z") + (fetchbower "bootstrap" "3.1.1" "3.1.1" "036xbjpv4621p5r2l9vfm9zys6h1mhkvb0zhvk3irrmkzsl77hwh") + (fetchbower "bootstrap-sass-official" "3.1.1" "3.1.1" "0rfmja15p8kxz6i3liwyqrmbm82azq61d3882w2vmp08vvv2c371") + (fetchbower "fontawesome" "4.4.0" "~4.4.0" "1mbs0vhixvg11vj3n0l3jn3pb6s839rcs416zq2wzfqkbvsc3sf5") + (fetchbower "highlightjs" "9.1.0" "~9.1.0" "1gz4q922sylbbqw1sawmjjq8nw0mk90wq0qq95ap0f31px7bfm3f") + (fetchbower "moment" "2.8.4" "~2.8.3" "1h30g5an2m9dja09m1s93hsfb25pzl0iah8mmab7nispl3mb585z") + (fetchbower "ua-parser-js" "0.7.12" "~0.7.12" "1hrhi7cdf5zd86jz7ipbb23qvkfplghfa92wa3aysca1rpg5zgpd") + (fetchbower "jquery" "3.1.1" ">= 1.9.0" "0rkp1hakimnjh3rvlzi30w7qx9x1j0gzjpaajgljn79kd082sgpd") +]; } diff --git a/pkgs/servers/monitoring/uchiwa/bower.json b/pkgs/servers/monitoring/uchiwa/bower.json new file mode 100644 index 000000000000..1eb94f73e6b8 --- /dev/null +++ b/pkgs/servers/monitoring/uchiwa/bower.json @@ -0,0 +1,6 @@ +{ + "name": "uchiwa", + "dependencies": { + "uchiwa-web": "0.21.0" + } +} diff --git a/pkgs/servers/monitoring/uchiwa/default.nix b/pkgs/servers/monitoring/uchiwa/default.nix new file mode 100644 index 000000000000..e7cf3e8f70e4 --- /dev/null +++ b/pkgs/servers/monitoring/uchiwa/default.nix @@ -0,0 +1,50 @@ +{ stdenv, fetchFromGitHub, buildBowerComponents, buildGoPackage, makeWrapper }: + +let + inherit (import ./src.nix) version sha256; + owner = "sensu"; + repo = "uchiwa"; + + src = fetchFromGitHub { + inherit owner repo sha256; + rev = "${version}"; + }; + + backend = buildGoPackage { + name = "uchiwa-backend-${version}"; + goPackagePath = "github.com/${owner}/${repo}"; + inherit src; + postInstall = '' + cp go/src/github.com/sensu/uchiwa/public/index.html $out/ + ''; + }; + + frontend = buildBowerComponents { + name = "uchiwa-frontend-${version}"; + generated = ./bower-packages.nix; + inherit src; + }; + +in stdenv.mkDerivation rec { + name = "uchiwa-${version}"; + + inherit src; + + buildInputs = [ makeWrapper ]; + + buildCommand = '' + mkdir -p $out/bin $out/public + makeWrapper ${backend.bin}/bin/uchiwa $out/bin/uchiwa \ + --add-flags "-p $out/public" + ln -s ${backend.out}/index.html $out/public/index.html + ln -s ${frontend.out}/bower_components $out/public/bower_components + ''; + + meta = with stdenv.lib; { + description = "A Dashboard for the sensu monitoring framework"; + homepage = http://sensuapp.org/; + license = licenses.mit; + maintainers = with maintainers; [ peterhoeg ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/servers/monitoring/uchiwa/src.nix b/pkgs/servers/monitoring/uchiwa/src.nix new file mode 100644 index 000000000000..68aaa4a5249b --- /dev/null +++ b/pkgs/servers/monitoring/uchiwa/src.nix @@ -0,0 +1,4 @@ +{ + version = "0.22.1"; + sha256 = "15wa7zhchis2rh6jcqkindlidmbf3mryr3apnqnr27ydi2vlqn3g"; +} diff --git a/pkgs/servers/monitoring/uchiwa/update.sh b/pkgs/servers/monitoring/uchiwa/update.sh new file mode 100755 index 000000000000..2802037a4f52 --- /dev/null +++ b/pkgs/servers/monitoring/uchiwa/update.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p nodePackages.bower2nix curl.bin git.out jq.out + +set -euo pipefail +IFS=$'\n\t' + +# set -x + +REPO=sensu/uchiwa + +VERSION=$(curl https://api.github.com/repos/${REPO}/tags -s | jq '.[0]' -r | jq .name -r) + +t=$(mktemp) + +echo "Updating to: ${VERSION}" + +curl https://raw.githubusercontent.com/${REPO}/${VERSION}/bower.json -s > $t +bower2nix $t bower-packages.nix + +pushd $(git rev-parse --show-toplevel) +sha=$(nix-prefetch-url -A uchiwa.src) +popd + +cat <<_EOF > src.nix +{ + version = "${VERSION}"; + sha256 = "${sha}"; +} +_EOF + +rm $t |