Add base skeleton for `vagrant push`
This commit is contained in:
parent
abdf1fdd04
commit
a93fff103f
|
@ -16,6 +16,7 @@ module Vagrant
|
|||
autoload :Manager, "vagrant/plugin/v2/manager"
|
||||
autoload :Plugin, "vagrant/plugin/v2/plugin"
|
||||
autoload :Provider, "vagrant/plugin/v2/provider"
|
||||
autoload :Push, "vagrant/plugin/v2/push"
|
||||
autoload :Provisioner, "vagrant/plugin/v2/provisioner"
|
||||
autoload :SyncedFolder, "vagrant/plugin/v2/synced_folder"
|
||||
end
|
||||
|
|
|
@ -221,6 +221,19 @@ module Vagrant
|
|||
data[:provisioners]
|
||||
end
|
||||
|
||||
# Registers additional pushes to be available.
|
||||
#
|
||||
# @param [String] name Name of the push.
|
||||
def self.push(name=UNSET_VALUE, &block)
|
||||
data[:pushes] ||= Registry.new
|
||||
|
||||
# Register a new pusher class only if a name was given
|
||||
data[:pushes].register(name.to_sym, &block) if name != UNSET_VALUE
|
||||
|
||||
# Return the registry
|
||||
data[:pushes]
|
||||
end
|
||||
|
||||
# Registers additional synced folder implementations.
|
||||
#
|
||||
# @param [String] name Name of the implementation.
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
module Vagrant
|
||||
module Plugin
|
||||
module V2
|
||||
class Push
|
||||
attr_reader :machine
|
||||
attr_reader :config
|
||||
|
||||
# Initializes the pusher with the machine that exists for this project
|
||||
# as well as the configuration (the push configuration, not the full machine
|
||||
# configuration).
|
||||
#
|
||||
# The pusher should _not_ do anything at this point except
|
||||
# initialize internal state.
|
||||
#
|
||||
# @param [Machine] machine The machine associated with this code.
|
||||
# @param [Object] config Push configuration, if one was set.
|
||||
def initialize(machine, config)
|
||||
@machine = machine
|
||||
@config = config
|
||||
end
|
||||
|
||||
# This is the method called when the actual pushing should be
|
||||
# done.
|
||||
#
|
||||
# No return value is expected.
|
||||
def push
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue