Skip to content

Commit bbba223

Browse files
committed
- source rvm
- change gitlab-shell hook
1 parent 5a8193b commit bbba223

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

manifests/install.pp

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
}
2828

2929
exec { 'install gitlab-shell':
30-
command => "ruby ${git_home}/gitlab-shell/bin/install",
30+
command => "bash -c 'source /etc/profile.d/rvm.sh; ruby ${git_home}/gitlab-shell/bin/install'",
3131
cwd => $git_home,
3232
creates => "${gitlab_repodir}/repositories",
3333
require => File["${git_home}/gitlab-shell/config.yml"],
@@ -62,9 +62,9 @@
6262
}
6363

6464
exec { 'install gitlab':
65-
command => "bundle install --without development aws test ${gitlab_without_gems} --deployment",
65+
command => "bash -c 'source /etc/profile.d/rvm.sh; bundle install --without development aws test ${gitlab_without_gems} --deployment'",
6666
cwd => "${git_home}/gitlab",
67-
unless => 'bundle check',
67+
unless => "bash -c 'source /etc/profile.d/rvm.sh; bundle check'",
6868
timeout => 0,
6969
require => [
7070
File["${git_home}/gitlab/config/database.yml"],
@@ -75,15 +75,15 @@
7575
}
7676

7777
exec { 'setup gitlab database':
78-
command => '/usr/bin/yes yes | bundle exec rake gitlab:setup RAILS_ENV=production',
78+
command => "bash -c 'source /etc/profile.d/rvm.sh; /usr/bin/yes yes | bundle exec rake gitlab:setup RAILS_ENV=production'",
7979
cwd => "${git_home}/gitlab",
8080
creates => "${git_home}/.gitlab_setup_done",
8181
require => Exec['install gitlab'],
8282
notify => Exec['precompile assets'],
8383
}
8484

8585
exec { 'precompile assets':
86-
command => 'bundle exec rake assets:precompile RAILS_ENV=production',
86+
command => "bash -c 'source /etc/profile.d/rvm.sh; bundle exec rake assets:precompile RAILS_ENV=production'",
8787
cwd => "${git_home}/gitlab",
8888
refreshonly => true,
8989
}
@@ -96,4 +96,18 @@
9696
require => Exec['setup gitlab database'];
9797
}
9898

99+
exec { 'rename_gitlab_shell_update_hook':
100+
command => "/bin/mv ${git_home}/gitlab-shell/hooks/update ${git_home}/gitlab-shell/hooks/gitlab-shell-update.rb",
101+
creates => "${git_home}/gitlab-shell/hooks/gitlab-shell-update.rb",
102+
require => File["${git_home}/.gitlab_setup_done"],
103+
}
104+
105+
file { 'new_gitlab_shell_update_hook':
106+
path => "${git_home}/gitlab-shell/hooks/update",
107+
ensure => present,
108+
mode => '0755',
109+
content => "#!/bin/bash \nsource /etc/profile.d/rvm.sh \n${git_home}/gitlab-shell/hooks/gitlab-shell-update.rb\n",
110+
require => Exec['rename_gitlab_shell_update_hook'],
111+
}
112+
99113
}

0 commit comments

Comments
 (0)