From 6bd8c6ca79963e22e96a85cf6f03a1b9c101fcf5 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 28 Oct 2014 20:06:19 -0700 Subject: [PATCH] command/push: support custom endpoints --- command/push.go | 10 +++++++++- packer/template.go | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/command/push.go b/command/push.go index 9e7c735bb..4e315f36c 100644 --- a/command/push.go +++ b/command/push.go @@ -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 diff --git a/packer/template.go b/packer/template.go index 562d23edd..0c0bd9bf0 100644 --- a/packer/template.go +++ b/packer/template.go @@ -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