lib/modulesync.rb in modulesync-1.3.0 vs lib/modulesync.rb in modulesync-2.0.0
- old
+ new
@@ -130,10 +130,11 @@
files_to_manage = settings.managed_files(module_files)
files_to_manage.each { |filename| manage_file(filename, settings, options) }
if options[:noop]
Git.update_noop(git_repo, options)
+ options[:pr] && pr(module_options).manage(namespace, module_name, options)
elsif !options[:offline]
pushed = Git.update(git_repo, files_to_manage, options)
pushed && options[:pr] && pr(module_options).manage(namespace, module_name, options)
end
end
@@ -169,11 +170,12 @@
errors = false
# managed_modules is either an array or a hash
managed_modules.each do |puppet_module, module_options|
begin
- manage_module(puppet_module, module_files, module_options, defaults, options)
+ mod_options = module_options.nil? ? nil : Util.symbolize_keys(module_options)
+ manage_module(puppet_module, module_files, mod_options, defaults, options)
rescue # rubocop:disable Lint/RescueWithoutErrorClass
$stderr.puts "Error while updating #{puppet_module}"
raise unless options[:skip_broken]
errors = true
$stdout.puts "Skipping #{puppet_module} as update process failed"
@@ -181,9 +183,10 @@
end
exit 1 if errors && options[:fail_on_warnings]
end
def self.pr(module_options)
+ module_options ||= {}
github_conf = module_options[:github]
gitlab_conf = module_options[:gitlab]
if !github_conf.nil?
base_url = github_conf[:base_url] || ENV.fetch('GITHUB_BASE_URL', 'https://api.github.com')