Skip to content

Commit 3de84eb

Browse files
committed
Allow specifying extra gemfiles for a plugin
1 parent b72d58f commit 3de84eb

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

manifests/config.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
settings_template => 'katello_devel/katello.yaml.erb',
4949
scm_revision => $katello_scm_revision,
5050
manage_repo => $katello_manage_repo,
51+
extra_gemfiles => ['gemfile.d/test.rb'],
5152
}
5253

5354
katello_devel::plugin { 'theforeman/foreman_remote_execution':

manifests/plugin.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@
99
#
1010
# @param manage_repo
1111
# Set to false if the plugin source repository is managed externally.
12+
#
13+
# @param extra_gemfiles
14+
# Additional gemfiles a plugin needs added
1215
define katello_devel::plugin (
1316
Optional[String] $settings_template = undef,
1417
Optional[String] $scm_revision = undef,
1518
Boolean $manage_repo = true,
19+
Array[String] $extra_gemfiles = [],
1620
) {
1721
$split_array = split($name, '/')
1822
$github_organization = $split_array[0]

spec/classes/katello_devel_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@
9393
' :katello_applicability: true',
9494
])
9595
end
96+
97+
it do
98+
verify_exact_contents(catalogue, '/home/vagrant/foreman/bundler.d/katello.local.rb', [
99+
"gemspec :path => '../katello', :development_group => 'katello_dev', :name => 'katello'",
100+
"eval_gemfile('/home/vagrant/katello/gemfile.d/test.rb')"
101+
])
102+
end
96103
end
97104

98105
describe 'with modulestream_nodejs' do

templates/plugin.local.rb.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
gemspec :path => '../<%= scope['plugin'] %>', :development_group => '<%= scope['plugin'] %>_dev', :name => '<%= scope['plugin'] %>'
2-
Dir['../<%= scope['plugin'] %>/gemfile.d/*.rb'].each do |file|
3-
eval_gemfile(file)
4-
end
2+
<%- for gemfile in scope['extra_gemfiles'] %>
3+
eval_gemfile('<%= scope['katello_devel::deployment_dir'] %>/<%= scope['plugin'] %>/<%= gemfile %>')
4+
<%- end %>

0 commit comments

Comments
 (0)