From 07e75495e8f7603c96f96d50b1a1cd351b95dc7a Mon Sep 17 00:00:00 2001 From: James Hillyerd Date: Sun, 6 Jan 2019 13:44:35 -0800 Subject: [PATCH] build: Update goreleaser for Elm UI --- .goreleaser.yml | 13 +++++++++++-- doc/config.md | 4 ++-- pkg/config/config.go | 2 +- shell.nix | 2 ++ 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 03764a7..7bb4cc9 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -12,8 +12,14 @@ brew: email: goreleaser@carlosbecker.com install: bin.install "" +before: + hooks: + - go mod download + builds: - binary: inbucket + env: + - CGO_ENABLED=0 goos: - darwin - freebsd @@ -26,6 +32,8 @@ builds: main: ./cmd/inbucket ldflags: -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} - binary: inbucket-client + env: + - CGO_ENABLED=0 goos: - darwin - freebsd @@ -51,7 +59,8 @@ archive: - README* - CHANGELOG* - etc/**/* - - ui/**/* + - ui/dist/**/* + - ui/greeting.html nfpm: vendor: inbucket.org @@ -63,7 +72,7 @@ nfpm: - deb - rpm files: - "ui/**/*": "/usr/local/share/inbucket/ui" + "ui/dist/**/*": "/usr/local/share/inbucket/ui" config_files: "etc/linux/inbucket.service": "/lib/systemd/system/inbucket.service" "ui/greeting.html": "/etc/inbucket/greeting.html" diff --git a/doc/config.md b/doc/config.md index cb0ce12..00dc444 100644 --- a/doc/config.md +++ b/doc/config.md @@ -28,7 +28,7 @@ variables it supports: INBUCKET_POP3_DOMAIN inbucket HELLO domain INBUCKET_POP3_TIMEOUT 600s Idle network timeout INBUCKET_WEB_ADDR 0.0.0.0:9000 Web server IP4 host:port - INBUCKET_WEB_UIDIR ui User interface dir + INBUCKET_WEB_UIDIR ui/dist User interface dir INBUCKET_WEB_GREETINGFILE ui/greeting.html Home page greeting HTML INBUCKET_WEB_MONITORVISIBLE true Show monitor tab in UI? INBUCKET_WEB_MONITORHISTORY 30 Monitor remembered messages @@ -295,7 +295,7 @@ doesn't contain the `ui` directory at startup. Inbucket will load templates from the `templates` sub-directory, and serve static assets from the `static` sub-directory. -- Default: `ui` +- Default: `ui/dist` - Values: Operating system specific path syntax ### Greeting HTML File diff --git a/pkg/config/config.go b/pkg/config/config.go index 0202d28..c1ed92c 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -93,7 +93,7 @@ type POP3 struct { // Web contains the HTTP server configuration. type Web struct { Addr string `required:"true" default:"0.0.0.0:9000" desc:"Web server IP4 host:port"` - UIDir string `required:"true" default:"ui" desc:"User interface dir"` + UIDir string `required:"true" default:"ui/dist" desc:"User interface dir"` GreetingFile string `required:"true" default:"ui/greeting.html" desc:"Home page greeting HTML"` MonitorVisible bool `required:"true" default:"true" desc:"Show monitor tab in UI?"` MonitorHistory int `required:"true" default:"30" desc:"Monitor remembered messages"` diff --git a/shell.nix b/shell.nix index f2b85b5..4488979 100644 --- a/shell.nix +++ b/shell.nix @@ -3,11 +3,13 @@ stdenv.mkDerivation rec { name = "env"; env = buildEnv { name = name; paths = buildInputs; }; buildInputs = [ + dpkg elmPackages.elm elmPackages.elm-format go golint nodejs + rpm swaks ]; }