-
Notifications
You must be signed in to change notification settings - Fork 75
Using rbenv instead of system ruby #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9fbf010
68cb233
1833dd4
0129a5d
412b0fc
ddacc3e
2a76640
933c006
9363f88
ab7b774
eff4aea
44c9b3a
9d9a91f
bb5f36c
ffd333d
e72c937
daad63a
7a58067
e3c7b21
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,16 @@ | ||
| fixtures: | ||
| symlinks: | ||
| "gitlab": "#{source_dir}" | ||
| gitlab: "#{source_dir}" | ||
| repositories: | ||
| "stdlib": "git://github.com/puppetlabs/puppetlabs-stdlib.git" | ||
| "vcsrepo": "git://github.com/puppetlabs/puppetlabs-vcsrepo.git" | ||
| "git": "git://github.com/puppetlabs/puppetlabs-git.git" | ||
| git: | ||
| repo: "git://github.com/puppetlabs/puppetlabs-git.git" | ||
| ref: "0.0.3" | ||
| rbenv: | ||
| repo: "git://github.com/alup/puppet-rbenv.git" | ||
| ref: "6628a24" | ||
| stdlib: | ||
| repo: "git://github.com/puppetlabs/puppetlabs-stdlib.git" | ||
| ref: "4.2.1" | ||
| vcsrepo: | ||
| repo: "git://github.com/puppetlabs/puppetlabs-vcsrepo.git" | ||
| ref: "0.2.0" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -77,18 +77,40 @@ | |
| } | ||
| } # Case $::osfamily | ||
|
|
||
| # system packages | ||
| package { 'bundler': | ||
| ensure => installed, | ||
| provider => gem, | ||
| } | ||
|
|
||
| # dev. dependencies | ||
| ensure_packages($system_packages) | ||
|
|
||
| package { 'charlock_holmes': | ||
| ensure => '0.6.9.4', | ||
| provider => gem, | ||
| rbenv::install { $git_user: | ||
| group => $git_user, | ||
| home => $git_home, | ||
|
|
||
| } | ||
|
|
||
| # By default, puppet-rbenv sets ~/.profile to load rbenv, which is | ||
| # read when bash is invoked as an interactive login shell, but we | ||
| # also need ~/.bashrc to load rbenv (which is read by interactive | ||
| # but non-login shells). This works, but may not be the best | ||
| # solution, please see issue #114 if you have a better solution. | ||
| file { "${git_home}/.bashrc": | ||
| ensure => link, | ||
| target => "${git_home}/.profile", | ||
| require => Rbenv::Install[$git_user], | ||
| } | ||
|
|
||
| rbenv::compile { 'gitlab/ruby': | ||
| user => $git_user, | ||
| home => $git_home, | ||
| ruby => $gitlab_ruby_version, | ||
| global => true, | ||
| notify => [ Exec['install gitlab-shell'], | ||
| Exec['install gitlab'] ], | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i'd write this as notify => [
Exec['install gitlab-shell'],
Exec['install gitlab'],
],
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (There's no definite word on that in the puppet style guide so… |
||
| } | ||
|
|
||
| rbenv::gem { 'charlock_holmes': | ||
| ensure => '0.6.9.4', | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should put this into a variable somewhere. Another time. |
||
| user => $git_user, | ||
| home => $git_home, | ||
| ruby => $gitlab_ruby_version, | ||
| } | ||
|
|
||
| # other packages | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,7 +81,7 @@ | |
| it { should contain_file('/home/git/gitlab-shell/config.yml').with_content(/^\s*port: 6379$/)} | ||
| it { should contain_exec('install gitlab-shell').with( | ||
| :user => 'git', | ||
| :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', | ||
| :path => '/home/git/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', | ||
| :command => 'ruby /home/git/gitlab-shell/bin/install', | ||
| :cwd => '/home/git', | ||
| :creates => '/home/git/repositories', | ||
|
|
@@ -159,7 +159,7 @@ | |
| describe 'install gitlab' do | ||
| it { should contain_exec('install gitlab').with( | ||
| :user => 'git', | ||
| :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', | ||
| :path => '/home/git/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what's with the spacing here? |
||
| :command => "bundle install --without development aws test postgres --deployment", | ||
| :unless => 'bundle check', | ||
| :cwd => '/home/git/gitlab', | ||
|
|
@@ -180,7 +180,7 @@ | |
| let(:params) {{ :gitlab_dbtype => 'pgsql' }} | ||
| it { should contain_exec('install gitlab').with( | ||
| :user => 'git', | ||
| :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', | ||
| :path => '/home/git/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', | ||
| :command => "bundle install --without development aws test mysql --deployment", | ||
| :unless => 'bundle check', | ||
| :cwd => '/home/git/gitlab', | ||
|
|
@@ -195,7 +195,7 @@ | |
| describe 'setup gitlab database' do | ||
| it { should contain_exec('setup gitlab database').with( | ||
| :user => 'git', | ||
| :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', | ||
| :path => '/home/git/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', | ||
| :command => '/usr/bin/yes yes | bundle exec rake gitlab:setup RAILS_ENV=production', | ||
| :cwd => '/home/git/gitlab', | ||
| :creates => '/home/git/.gitlab_setup_done', | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,11 +13,12 @@ | |
| # a non-default common parameter set | ||
| let :params_set do | ||
| { | ||
| :git_user => 'gitlab', | ||
| :git_home => '/srv/gitlab', | ||
| :git_comment => 'Labfooboozoo', | ||
| :git_email => '[email protected]', | ||
| :git_proxy => 'http://proxy.fooboozoo.fr:3128' | ||
| :git_user => 'gitlab', | ||
| :git_home => '/srv/gitlab', | ||
| :git_comment => 'Labfooboozoo', | ||
| :git_email => '[email protected]', | ||
| :git_proxy => 'http://proxy.fooboozoo.fr:3128', | ||
| :gitlab_ruby_version => '2.0.0' | ||
| } | ||
| end | ||
|
|
||
|
|
@@ -41,7 +42,7 @@ | |
| it { should contain_file('/home/git').with(:ensure => 'directory', :mode => '0755')} | ||
| it { should contain_file('/home/git/gitlab-satellites').with(:ensure => 'directory', :mode => '0750')} | ||
| end | ||
| context 'with specifics params' do | ||
| context 'with specific params' do | ||
| let(:params) { params_set } | ||
| it { should contain_user(params_set[:git_user]).with( | ||
| :ensure => 'present', | ||
|
|
@@ -59,8 +60,50 @@ | |
| end | ||
| end | ||
|
|
||
| ### Ruby | ||
| describe 'rbenv' do | ||
| context 'with default params' do | ||
| it { should contain_rbenv__install('git').with( | ||
| :group => 'git', | ||
| :home => '/home/git' | ||
| )} | ||
| it { should contain_file('/home/git/.bashrc').with( | ||
| :ensure => 'link', | ||
| :target => '/home/git/.profile', | ||
| :require => 'Rbenv::Install[git]' | ||
| )} | ||
| it { should contain_rbenv__compile('gitlab/ruby').with( | ||
| :user => 'git', | ||
| :home => '/home/git', | ||
| :ruby => '2.1.2', | ||
| :global => true, | ||
| :notify => ['Exec[install gitlab-shell]', 'Exec[install gitlab]'] | ||
| )} | ||
|
|
||
| end | ||
| context 'with specific params' do | ||
| let(:params) { params_set } | ||
| it { should contain_rbenv__install(params_set[:git_user]).with( | ||
| :group => params_set[:git_user], | ||
| :home => params_set[:git_home] | ||
| )} | ||
| it { should contain_file('/srv/gitlab/.bashrc').with( | ||
| :ensure => 'link', | ||
| :target => '/srv/gitlab/.profile', | ||
| :require => 'Rbenv::Install[gitlab]' | ||
| )} | ||
| it { should contain_rbenv__compile('gitlab/ruby').with( | ||
| :user => params_set[:git_user], | ||
| :home => params_set[:git_home], | ||
| :ruby => '2.0.0', | ||
| :global => true, | ||
| :notify => ['Exec[install gitlab-shell]', 'Exec[install gitlab]'] | ||
| )} | ||
| end | ||
| end | ||
|
|
||
| ### Sshkey | ||
| describe 'sshkey (hostfile)' do | ||
| describe 'sshkey (hostfile)' do | ||
| it { should contain_sshkey('localhost').with( | ||
| :ensure => 'present', | ||
| :host_aliases => 'gitlab.fooboozoo.fr', | ||
|
|
@@ -118,13 +161,8 @@ | |
| end | ||
| #### Gems (all dist.) | ||
| describe 'commons gems' do | ||
| it { should contain_package('bundler').with( | ||
| :ensure => 'installed', | ||
| :provider => 'gem' | ||
| )} | ||
| it { should contain_package('charlock_holmes').with( | ||
| :ensure => '0.6.9.4', | ||
| :provider => 'gem' | ||
| it { should contain_rbenv__gem('charlock_holmes').with( | ||
| :ensure => '0.6.9.4' | ||
| )} | ||
| end | ||
| #### Commons packages (all dist.) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove this space