Make it possible to define custom gitlab.rb files
In order to enable different parts of GitLab (e.g. Mattermost, LDAP, etc), we need to be able to customize /etc/gitlab/gitlab.rb
. There are two ways I thought we might be able to do this:
- Mount the
/etc/gitlab
directory as a volume - Make it possible to append entries to
/etc/gitlab/gitlab.rb
and runreconfigure
The second way seemed simpler, but it's a bit slow because you have to run reconfigure
twice. I attempted to do the first way via:
diff --git a/lib/gitlab/qa/scenario/test/instance/image.rb b/lib/gitlab/qa/scenario/test/instance/image.rb
index d377b3b..041baa2 100644
--- a/lib/gitlab/qa/scenario/test/instance/image.rb
+++ b/lib/gitlab/qa/scenario/test/instance/image.rb
@@ -8,6 +8,8 @@ module Gitlab
def initialize
@volumes = {}
+
+ volumes[ENV['ETC_GITLAB_DIR']] = '/etc/gitlab' if ENV['ETC_GITLAB_DIR']
end
def perform(release)
That did what I wanted, but the tricky part is that external_url
needs to be set the Docker hostname (e.g. http://gitlab-qa-XXX). This is done by default on a new Docker install, but it isn't if we are providing a gitlab.rb
already.
Do we need to consider providing a gitlab.rb.erb
template that can be filled in by GitLab QA, or should we just go with approach 2 above?
/cc: @grzesiek, @rspeicher