From 8c78449a9ef8f2a77cc1ff94f9a0a3178af21408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 19 Oct 2017 13:59:02 +0300 Subject: cmd/puppeth: reorganize stats reports to make it readable --- cmd/puppeth/module_nginx.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'cmd/puppeth/module_nginx.go') diff --git a/cmd/puppeth/module_nginx.go b/cmd/puppeth/module_nginx.go index fd6d1d74e..67084c80a 100644 --- a/cmd/puppeth/module_nginx.go +++ b/cmd/puppeth/module_nginx.go @@ -22,6 +22,7 @@ import ( "html/template" "math/rand" "path/filepath" + "strconv" "github.com/ethereum/go-ethereum/log" ) @@ -88,9 +89,12 @@ type nginxInfos struct { port int } -// String implements the stringer interface. -func (info *nginxInfos) String() string { - return fmt.Sprintf("port=%d", info.port) +// Report converts the typed struct into a plain string->string map, cotnaining +// most - but not all - fields for reporting to the user. +func (info *nginxInfos) Report() map[string]string { + return map[string]string{ + "Shared listener port": strconv.Itoa(info.port), + } } // checkNginx does a health-check against an nginx reverse-proxy to verify whether -- cgit v1.2.3 From da3b9f831e6bb8f8a3c589e5cd8426fd9da72eea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 19 Oct 2017 16:00:55 +0300 Subject: cmd/puppeth: support deploying services with forced rebuilds --- cmd/puppeth/module_nginx.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'cmd/puppeth/module_nginx.go') diff --git a/cmd/puppeth/module_nginx.go b/cmd/puppeth/module_nginx.go index 67084c80a..ade0e4963 100644 --- a/cmd/puppeth/module_nginx.go +++ b/cmd/puppeth/module_nginx.go @@ -55,7 +55,7 @@ services: // deployNginx deploys a new nginx reverse-proxy container to expose one or more // HTTP services running on a single host. If an instance with the specified // network name already exists there, it will be overwritten! -func deployNginx(client *sshClient, network string, port int) ([]byte, error) { +func deployNginx(client *sshClient, network string, port int, nocache bool) ([]byte, error) { log.Info("Deploying nginx reverse-proxy", "server", client.server, "port", port) // Generate the content to upload to the server @@ -79,8 +79,11 @@ func deployNginx(client *sshClient, network string, port int) ([]byte, error) { } defer client.Run("rm -rf " + workdir) - // Build and deploy the ethstats service - return nil, client.Stream(fmt.Sprintf("cd %s && docker-compose -p %s up -d --build", workdir, network)) + // Build and deploy the reverse-proxy service + if nocache { + return nil, client.Stream(fmt.Sprintf("cd %s && docker-compose -p %s build --pull --no-cache && docker-compose -p %s up -d --force-recreate", workdir, network, network)) + } + return nil, client.Stream(fmt.Sprintf("cd %s && docker-compose -p %s up -d --build --force-recreate", workdir, network)) } // nginxInfos is returned from an nginx reverse-proxy status check to allow -- cgit v1.2.3 From a3a2c6b0d9f963c9377612cae1ed6ded6f216c2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 23 Nov 2017 14:22:59 +0200 Subject: cmd/puppeth: fix typos and review suggestions --- cmd/puppeth/module_nginx.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/puppeth/module_nginx.go') diff --git a/cmd/puppeth/module_nginx.go b/cmd/puppeth/module_nginx.go index ade0e4963..35c0efc8a 100644 --- a/cmd/puppeth/module_nginx.go +++ b/cmd/puppeth/module_nginx.go @@ -92,7 +92,7 @@ type nginxInfos struct { port int } -// Report converts the typed struct into a plain string->string map, cotnaining +// Report converts the typed struct into a plain string->string map, containing // most - but not all - fields for reporting to the user. func (info *nginxInfos) Report() map[string]string { return map[string]string{ -- cgit v1.2.3