aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/puppeth/module_nginx.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/puppeth/module_nginx.go')
-rw-r--r--cmd/puppeth/module_nginx.go19
1 files changed, 13 insertions, 6 deletions
diff --git a/cmd/puppeth/module_nginx.go b/cmd/puppeth/module_nginx.go
index fd6d1d74e..35c0efc8a 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"
)
@@ -54,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
@@ -78,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
@@ -88,9 +92,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, containing
+// 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