Skip to content

Commit

Permalink
Support custom install command for plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
renepavlik committed Sep 7, 2015
1 parent 046ceaf commit 06f30a2
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions manifests/plugin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@

define redmine::plugin
(
$provider = 'git',
$source = undef,
$revision = "origin/master",
$migrate = false,
$rake = [],
$provider = 'git',
$source = undef,
$revision = 'origin/master',
$install_command = undef,
$migrate = false,
$rake = [],
)
{
$rvm_ruby = $redmine::rvm_ruby
Expand Down Expand Up @@ -49,9 +50,10 @@
->

exec { "bundle-${name}-plugin":
path => '/bin:/usr/bin',
command => "bash -c '${rvm_prefix}cd ${app_root}/current; bundle --without ${redmine::without_gems}'",
unless => "bash -c '${rvm_prefix}cd ${app_root}/current; bundle check'",
path => '/usr/local/bin:/bin:/usr/bin',
command => install_command ? { undef => '/bin/true',
default => "bash -c '${rvm_prefix}cd ${app_root}/current; ${install_command}'",
},
notify => Service['redmine'],
user => $redmine_user,
group => $redmine_user,
Expand All @@ -61,7 +63,7 @@
->

exec { "migrate-${name}-plugin":
path => "/usr/bin:/bin",
path => '/usr/local/bin:/usr/bin:/bin',
user => $redmine_user,
command => $migrate ? {
true => "bash -c '${rvm_prefix}cd ${redmine_dir}; RAILS_ENV=production bundle exec rake db:migrate'",
Expand Down

0 comments on commit 06f30a2

Please sign in to comment.