|
27 | 27 | } |
28 | 28 |
|
29 | 29 | 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'", |
31 | 31 | cwd => $git_home, |
32 | 32 | creates => "${gitlab_repodir}/repositories", |
33 | 33 | require => File["${git_home}/gitlab-shell/config.yml"], |
|
62 | 62 | } |
63 | 63 |
|
64 | 64 | 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'", |
66 | 66 | cwd => "${git_home}/gitlab", |
67 | | - unless => 'bundle check', |
| 67 | + unless => "bash -c 'source /etc/profile.d/rvm.sh; bundle check'", |
68 | 68 | timeout => 0, |
69 | 69 | require => [ |
70 | 70 | File["${git_home}/gitlab/config/database.yml"], |
|
75 | 75 | } |
76 | 76 |
|
77 | 77 | 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'", |
79 | 79 | cwd => "${git_home}/gitlab", |
80 | 80 | creates => "${git_home}/.gitlab_setup_done", |
81 | 81 | require => Exec['install gitlab'], |
82 | 82 | notify => Exec['precompile assets'], |
83 | 83 | } |
84 | 84 |
|
85 | 85 | 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'", |
87 | 87 | cwd => "${git_home}/gitlab", |
88 | 88 | refreshonly => true, |
89 | 89 | } |
|
96 | 96 | require => Exec['setup gitlab database']; |
97 | 97 | } |
98 | 98 |
|
| 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 | + |
99 | 113 | } |
0 commit comments