Method: ModuleSync.push

Defined in:
lib/modulesync.rb

.push(cli_options) ⇒ Object



263
264
265
266
267
268
269
270
271
272
273
274
275
276
# File 'lib/modulesync.rb', line 263

def self.push(cli_options)
  @options = config_defaults.merge(cli_options)

  if @options[:branch].nil?
    raise Thor::Error,
          "Error: 'branch' option is missing, please set it in configuration or in command line."
  end

  managed_modules.each do |puppet_module|
    puppet_module.repository.push branch: @options[:branch], remote_branch: @options[:remote_branch]
  rescue ModuleSync::Error => e
    raise Thor::Error, "#{puppet_module.given_name}: #{e.message}"
  end
end