@@ -1,4 +1,4 @@
|
||||
SUBCOMMANDS = subcommands/disable subcommands/enable subcommands/ports subcommands/ports-add subcommands/ports-clear subcommands/ports-remove subcommands/ports-set subcommands/report subcommands/set
|
||||
SUBCOMMANDS = subcommands/build-config subcommands/disable subcommands/enable subcommands/ports subcommands/ports-add subcommands/ports-clear subcommands/ports-remove subcommands/ports-set subcommands/report subcommands/set
|
||||
TRIGGERS = triggers/proxy-is-enabled triggers/proxy-type triggers/post-certs-remove triggers/post-certs-update triggers/report
|
||||
BUILD = commands subcommands triggers
|
||||
PLUGIN_NAME = proxy
|
||||
|
||||
@@ -18,6 +18,7 @@ Manage the proxy integration for an app
|
||||
Additional commands:`
|
||||
|
||||
helpContent = `
|
||||
proxy:build-config <app>, (Re)builds config for a given app
|
||||
proxy:disable <app>, Disable proxy for app
|
||||
proxy:enable <app>, Enable proxy for app
|
||||
proxy:ports <app>, List proxy port mappings for app
|
||||
|
||||
@@ -17,6 +17,11 @@ func main() {
|
||||
|
||||
var err error
|
||||
switch subcommand {
|
||||
case "build-config":
|
||||
args := flag.NewFlagSet("proxy:build-config", flag.ExitOnError)
|
||||
args.Parse(os.Args[2:])
|
||||
appName := args.Arg(0)
|
||||
err = proxy.CommandBuildConfig(appName)
|
||||
case "disable":
|
||||
args := flag.NewFlagSet("proxy:disable", flag.ExitOnError)
|
||||
skipRestart := args.Bool("no-restart", false, "--no-restart: skip restart of the app")
|
||||
|
||||
@@ -8,6 +8,19 @@ import (
|
||||
"github.com/dokku/dokku/plugins/config"
|
||||
)
|
||||
|
||||
// CommandBuildConfig rebuilds config for a given app
|
||||
func CommandBuildConfig(appName string) error {
|
||||
if appName == "" {
|
||||
return errors.New("Please specify an app to run the command on")
|
||||
}
|
||||
|
||||
if err := common.VerifyAppName(appName); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return common.PlugnTrigger("proxy-build-config", []string{appName}...)
|
||||
}
|
||||
|
||||
// CommandDisable disables the proxy for app via command line
|
||||
func CommandDisable(appName string, skipRestart bool) error {
|
||||
if appName == "" {
|
||||
|
||||
Reference in New Issue
Block a user