aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/puppeth/module_nginx.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_nginx.go
parent7b258c96816df56e642df7e314e8052213af70fa (diff)
downloadgo-tangerine-da3b9f831e6bb8f8a3c589e5cd8426fd9da72eea.tar
go-tangerine-da3b9f831e6bb8f8a3c589e5cd8426fd9da72eea.tar.gz
go-tangerine-da3b9f831e6bb8f8a3c589e5cd8426fd9da72eea.tar.bz2
go-tangerine-da3b9f831e6bb8f8a3c589e5cd8426fd9da72eea.tar.lz
go-tangerine-da3b9f831e6bb8f8a3c589e5cd8426fd9da72eea.tar.xz
go-tangerine-da3b9f831e6bb8f8a3c589e5cd8426fd9da72eea.tar.zst
go-tangerine-da3b9f831e6bb8f8a3c589e5cd8426fd9da72eea.zip
cmd/puppeth: support deploying services with forced rebuilds
Diffstat (limited to 'cmd/puppeth/module_nginx.go')
-rw-r--r--cmd/puppeth/module_nginx.go9
1 files changed, 6 insertions, 3 deletions
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