aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/puppeth/module_dashboard.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-10-19 21:00:55 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-11-21 21:09:33 +0800
commitda3b9f831e6bb8f8a3c589e5cd8426fd9da72eea (patch)
treefb9cca2507788d43e79113a42d9abc3e221e6378 /cmd/puppeth/module_dashboard.go
parent7b258c96816df56e642df7e314e8052213af70fa (diff)
downloaddexon-da3b9f831e6bb8f8a3c589e5cd8426fd9da72eea.tar.gz
dexon-da3b9f831e6bb8f8a3c589e5cd8426fd9da72eea.tar.zst
dexon-da3b9f831e6bb8f8a3c589e5cd8426fd9da72eea.zip
cmd/puppeth: support deploying services with forced rebuilds
Diffstat (limited to 'cmd/puppeth/module_dashboard.go')
-rw-r--r--cmd/puppeth/module_dashboard.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/cmd/puppeth/module_dashboard.go b/cmd/puppeth/module_dashboard.go
index 7d01f6f0a..b08dbbff1 100644
--- a/cmd/puppeth/module_dashboard.go
+++ b/cmd/puppeth/module_dashboard.go
@@ -437,7 +437,7 @@ services:
// deployDashboard deploys a new dashboard container to a remote machine via SSH,
// docker and docker-compose. If an instance with the specified network name
// already exists there, it will be overwritten!
-func deployDashboard(client *sshClient, network string, port int, vhost string, services map[string]string, conf *config, ethstats bool) ([]byte, error) {
+func deployDashboard(client *sshClient, network string, port int, vhost string, services map[string]string, conf *config, ethstats bool, nocache bool) ([]byte, error) {
// Generate the content to upload to the server
workdir := fmt.Sprintf("%d", rand.Int63())
files := make(map[string][]byte)
@@ -490,7 +490,10 @@ func deployDashboard(client *sshClient, network string, port int, vhost string,
defer client.Run("rm -rf " + workdir)
// Build and deploy the dashboard service
- return nil, client.Stream(fmt.Sprintf("cd %s && docker-compose -p %s up -d --build", workdir, network))
+ 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))
}
// dashboardInfos is returned from an dashboard status check to allow reporting