Merge pull request #49165 from nh2/consul-1.3.0

consul: 0.9.3 -> 1.3.0 with vendored UI
This commit is contained in:
Renaud 2018-11-03 19:05:35 +01:00 committed by GitHub
commit 32340793aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 24 additions and 162 deletions

View file

@ -162,6 +162,14 @@
has been renamed to <varname>postgresql_9_6</varname>.
</para>
</listitem>
<listitem>
<para>
Package <literal>consul-ui</literal> and passthrough <literal>consul.ui</literal> have been removed.
The package <literal>consul</literal> now uses upstream releases that vendor the UI into the binary.
See <link xlink:href="https://github.com/NixOS/nixpkgs/pull/48714#issuecomment-433454834">#48714</link>
for details.
</para>
</listitem>
<listitem>
<para>
Slurm introduces the new option

View file

@ -6,9 +6,10 @@ let
dataDir = "/var/lib/consul";
cfg = config.services.consul;
configOptions = { data_dir = dataDir; } //
(if cfg.webUi then { ui_dir = "${cfg.package.ui}"; } else { }) //
cfg.extraConfig;
configOptions = {
data_dir = dataDir;
ui = cfg.webUi;
} // cfg.extraConfig;
configFiles = [ "/etc/consul.json" "/etc/consul-addrs.json" ]
++ cfg.extraConfigFiles;

View file

@ -1,5 +0,0 @@
# A sample Gemfile
source "https://rubygems.org"
gem "uglifier"
gem "sass"

View file

@ -1,25 +0,0 @@
GEM
remote: https://rubygems.org/
specs:
execjs (2.7.0)
ffi (1.9.23)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
sass (3.5.6)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
uglifier (4.1.10)
execjs (>= 0.3.0, < 3)
PLATFORMS
ruby
DEPENDENCIES
sass
uglifier
BUNDLED WITH
1.14.6

View file

@ -1,22 +1,27 @@
{ stdenv, buildGoPackage, consul-ui, fetchFromGitHub }:
{ stdenv, buildGoPackage, fetchFromGitHub }:
buildGoPackage rec {
name = "consul-${version}";
version = "0.9.3";
version = "1.3.0";
rev = "v${version}";
goPackagePath = "github.com/hashicorp/consul";
# Note: Currently only release tags are supported, because they have the Consul UI
# vendored. See
# https://github.com/NixOS/nixpkgs/pull/48714#issuecomment-433454834
# If you want to use a non-release commit as `src`, you probably want to improve
# this derivation so that it can build the UI's JavaScript from source.
# See https://github.com/NixOS/nixpkgs/pull/49082 for something like that.
# Or, if you want to patch something that doesn't touch the UI, you may want
# to apply your changes as patches on top of a release commit.
src = fetchFromGitHub {
owner = "hashicorp";
repo = "consul";
inherit rev;
sha256 = "1176frp7kimpycsmz9wrbizf46jgxr8jq7hz5w4q1x90lswvrxv3";
sha256 = "1zv84snvrjm74w3v3rr27linsbxj00m73xd047sb78a4766xs2h0";
};
# Keep consul.ui for backward compatability
passthru.ui = consul-ui;
preBuild = ''
buildFlagsArray+=("-ldflags" "-X github.com/hashicorp/consul/version.GitDescribe=v${version} -X github.com/hashicorp/consul/version.Version=${version} -X github.com/hashicorp/consul/version.VersionPrerelease=")
'';
@ -26,6 +31,6 @@ buildGoPackage rec {
homepage = https://www.consul.io/;
platforms = platforms.linux ++ platforms.darwin;
license = licenses.mpl20;
maintainers = with maintainers; [ pradeepchhetri ];
maintainers = with maintainers; [ pradeepchhetri vdemeester nh2 ];
};
}

View file

@ -1,62 +0,0 @@
{
execjs = {
source = {
remotes = ["https://rubygems.org"];
sha256 = "1yz55sf2nd3l666ms6xr18sm2aggcvmb8qr3v53lr4rir32y1yp1";
type = "gem";
};
version = "2.7.0";
};
ffi = {
source = {
remotes = ["https://rubygems.org"];
sha256 = "0zw6pbyvmj8wafdc7l5h7w20zkp1vbr2805ql5d941g2b20pk4zr";
type = "gem";
};
version = "1.9.23";
};
rb-fsevent = {
source = {
remotes = ["https://rubygems.org"];
sha256 = "1lm1k7wpz69jx7jrc92w3ggczkjyjbfziq5mg62vjnxmzs383xx8";
type = "gem";
};
version = "0.10.3";
};
rb-inotify = {
dependencies = ["ffi"];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0yfsgw5n7pkpyky6a9wkf1g9jafxb0ja7gz0qw0y14fd2jnzfh71";
type = "gem";
};
version = "0.9.10";
};
sass = {
dependencies = ["sass-listen"];
source = {
remotes = ["https://rubygems.org"];
sha256 = "19wyzp9qsg8hdkkxlsv713w0qmy66qrdp0shj42587ssx4qhrlag";
type = "gem";
};
version = "3.5.6";
};
sass-listen = {
dependencies = ["rb-fsevent" "rb-inotify"];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0xw3q46cmahkgyldid5hwyiwacp590zj2vmswlll68ryvmvcp7df";
type = "gem";
};
version = "4.0.0";
};
uglifier = {
dependencies = ["execjs"];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0dycp9c5xiricla6sgvg0vf22i3axs5k1v1607dvl7nv1xkkaczi";
type = "gem";
};
version = "4.1.10";
};
}

View file

@ -1,17 +0,0 @@
diff --git a/ui/scripts/dist.sh b/ui/scripts/dist.sh
index 0ad6e28e..db340da0 100755
--- a/ui/scripts/dist.sh
+++ b/ui/scripts/dist.sh
@@ -15,10 +15,9 @@ DEPLOY="../pkg/web_ui"
rm -rf $DEPLOY
mkdir -p $DEPLOY
-bundle check >/dev/null 2>&1 || bundle install
-bundle exec sass styles/base.scss static/base.css
+sass styles/base.scss static/base.css
-bundle exec ruby scripts/compile.rb
+ruby scripts/compile.rb
# Copy into deploy
shopt -s dotglob

View file

@ -1,41 +0,0 @@
{ stdenv, consul, ruby, bundlerEnv, zip, nodejs }:
let
# `sass` et al
gems = bundlerEnv {
name = "consul-ui-deps";
gemdir = ./.;
};
in
stdenv.mkDerivation {
name = "consul-ui-${consul.version}";
src = consul.src;
buildInputs = [ ruby gems zip nodejs ];
patches = [ ./ui-no-bundle-exec.patch ];
postPatch = "patchShebangs ./ui/scripts/dist.sh";
buildPhase = ''
# Build ui static files
cd ui
make dist
'';
installPhase = ''
# Install ui static files
mkdir -p $out
mv ../pkg/web_ui/* $out
'';
meta = with stdenv.lib; {
homepage = https://www.consul.io/;
description = "A tool for service discovery, monitoring and configuration";
maintainers = with maintainers; [ cstrahan wkennington ];
license = licenses.mpl20 ;
platforms = platforms.unix;
};
}

View file

@ -1136,8 +1136,6 @@ with pkgs;
consul = callPackage ../servers/consul { };
consul-ui = callPackage ../servers/consul/ui.nix { };
consul-alerts = callPackage ../servers/monitoring/consul-alerts { };
consul-template = callPackage ../tools/system/consul-template { };