command/push: support custom endpoints

This commit is contained in:
Mitchell Hashimoto 2014-10-28 20:06:19 -07:00
parent 2f65b1bb67
commit 6bd8c6ca79
2 changed files with 10 additions and 1 deletions

View File

@ -58,8 +58,16 @@ func (c *PushCommand) Run(args []string) int {
}
// Build our client
c.client = harmony.DefaultClient()
defer func() { c.client = nil }()
c.client = harmony.DefaultClient()
if tpl.Push.Address != "" {
c.client, err = harmony.NewClient(tpl.Push.Address)
if err != nil {
c.Ui.Error(fmt.Sprintf(
"Error setting up API client: %s", err))
return 1
}
}
// Build the archiving options
var opts archive.ArchiveOpts

View File

@ -45,6 +45,7 @@ type Template struct {
// PushConfig is the configuration structure for the push settings.
type PushConfig struct {
Name string
Address string
BaseDir string
Include []string
Exclude []string