Install custom gems for omniauth
TBH I'm not sure this can be done with omnibus gitlab in a sane way as I can't find documentation that doesn't reference a Gemfile (which I don't think exists with omnibus).
Anyway I'm trying to get crowd authentication working, so I need to install the omniauth-crowd
gem and it needs to be there before the server starts with the new configuration - otherwise it fails.
My current workaround is to add the following to my recipe:
gem_package 'omniauth_crowd' do
gem_binary '/opt/gitlab/embedded/bin/gem'
action :nothing
subscribes :install, "package[#{node['gitlab_omnibus']['package_name']}]", :immediately
end
This should install the gem as soon as the package is installed but not sure how to deal with a situation where a gem becomes required due to a config change later - it's a super hacky solution
I think a better solution would be to have a node['gitlab_omnibus']['gems']
attribute and add the following to default.rb
between the package install and gitlab.rb
template
node['gitlab_omnibus']['gems'].each do |gem|
gem_package gem do
gem_binary '/opt/gitlab/embedded/bin/gem'
end
end
Not sure this is a recommended way to install gems in the omnibus edition and what might happen on upgrades (will they be deleted?). I wondered if an additional gem path (eg. /etc/gitlab/gems
) could be specified and then install the custom gems into there (still investigating)