From edbc3e74d4a99836fbac8b25b382547cab16077d Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Tue, 3 Feb 2015 19:19:51 -0500 Subject: [PATCH] Pass metadata to push command --- plugins/pushes/atlas/push.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/pushes/atlas/push.rb b/plugins/pushes/atlas/push.rb index 8a892fa2c..7def5077f 100644 --- a/plugins/pushes/atlas/push.rb +++ b/plugins/pushes/atlas/push.rb @@ -27,6 +27,7 @@ module VagrantPlugins cmd << "-vcs" if config.vcs cmd += config.includes.map { |v| ["-include", v] } cmd += config.excludes.map { |v| ["-exclude", v] } + cmd += metadata.map { |k,v| ["-metadata", "#{k}=#{v}"] } cmd += ["-address", config.address] if config.address cmd += ["-token", config.token] if config.token cmd << config.app @@ -53,6 +54,16 @@ module VagrantPlugins return Vagrant::Util::Which.which(UPLOADER_BIN) end + + # The metadata command for this push. + # + # @return [Array] + def metadata + hash = { + "box" => env.vagrantfile.config.vm.box, + "box_url" => env.vagrantfile.config.vm.box_url, + }.reject { |k,v| v.nil? || v.empty? } + end end end end