Yanis Guenane ca33eb9108 puppet-modulesync-configs: Initial commit
With this inital commit we set two things :

 * The list of project that will be managed by this repository[1]
 * The default template for shared resources, inspired from puppetlabs
   own modulesync_configs[2]

The actual content (ie. data) should be discussed during a meeting.

[1]
https://github.com/openstack-infra/project-config/blob/master/gerritbot/channels.yaml#L1043-L1069
[2] https://github.com/puppetlabs/modulesync_configs

Change-Id: I03b4f07594361ef50ed20589571b2d4c3072cbff
2015-04-20 16:31:57 +02:00

40 lines
1.4 KiB
Ruby

source ENV['GEM_SOURCE'] || "https://rubygems.org"
<% groups = {} -%>
<% (@configs['required'].keys + ((@configs['optional'] || {}).keys)).uniq.each do |key| -%>
<% groups[key] = (@configs['required'][key] || []) + ((@configs['optional'] || {})[key] || []) -%>
<% end -%>
<% -%>
<% groups.each do |group, gems| -%>
group <%= group %> do
<% maxlen = gems.map! do |gem| -%>
<% { -%>
<% 'gem' => gem['gem'], -%>
<% 'version' => gem['version'], -%>
<% 'git' => gem['git'], -%>
<% 'branch' => gem['branch'], -%>
<% 'length' => gem['gem'].length + (("', '".length if gem['version']) || 0) + gem['version'].to_s.length -%>
<% } -%>
<% end.map do |gem| -%>
<% gem['length'] -%>
<% end.max -%>
<% gems.each do |gem| -%>
gem '<%= gem['gem'] %>'<%= ", '#{gem['version']}'" if gem['version'] %>, <%= ' ' * (maxlen - gem['length']) %> :require => false<%= ", :git => '#{gem['git']}'" if gem['git'] %><%= ", :branch => '#{gem['branch']}'" if gem['branch'] %>
<% end -%>
end
<% end -%>
if facterversion = ENV['FACTER_GEM_VERSION']
gem 'facter', facterversion, :require => false
else
gem 'facter', :require => false
end
if puppetversion = ENV['PUPPET_GEM_VERSION']
gem 'puppet', puppetversion, :require => false
else
gem 'puppet', :require => false
end
# vim:ft=ruby