diff --git a/config/software/gitlab-cookbooks.rb b/config/software/gitlab-cookbooks.rb index 6b42f559a066fd2b501c45d28bef8bdea4437338_Y29uZmlnL3NvZnR3YXJlL2dpdGxhYi1jb29rYm9va3MucmI=..54ae36c68cc351b3b1db1aacad4b64f2ea5c0a2c_Y29uZmlnL3NvZnR3YXJlL2dpdGxhYi1jb29rYm9va3MucmI= 100644 --- a/config/software/gitlab-cookbooks.rb +++ b/config/software/gitlab-cookbooks.rb @@ -24,6 +24,7 @@ skip_transitive_dependency_licensing true EE = Build::Check.include_ee? +JH = Build::Check.is_jh? source path: File.expand_path('files/gitlab-cookbooks', Omnibus::Config.project_root) @@ -37,7 +38,7 @@ # If EE package, use a different master cookbook if EE - cookbook_name = 'gitlab-ee' + cookbook_name = JH ? 'gitlab-jh' : 'gitlab-ee' solo_recipes << 'geo-postgresql-config' solo_recipes << 'patroni-config' else diff --git a/files/gitlab-cookbooks/gitlab/recipes/gitlab-rails.rb b/files/gitlab-cookbooks/gitlab/recipes/gitlab-rails.rb index 6b42f559a066fd2b501c45d28bef8bdea4437338_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9naXRsYWIvcmVjaXBlcy9naXRsYWItcmFpbHMucmI=..54ae36c68cc351b3b1db1aacad4b64f2ea5c0a2c_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9naXRsYWIvcmVjaXBlcy9naXRsYWItcmFpbHMucmI= 100644 --- a/files/gitlab-cookbooks/gitlab/recipes/gitlab-rails.rb +++ b/files/gitlab-cookbooks/gitlab/recipes/gitlab-rails.rb @@ -317,6 +317,7 @@ mode "0640" mattermost_host = Gitlab['mattermost_external_url'] || node['gitlab']['gitlab_rails']['mattermost_host'] + has_jh_cookbook = File.exist?('/opt/gitlab/embedded/cookbooks/gitlab-jh') variables( node['gitlab']['gitlab_rails'].to_hash.merge( @@ -339,7 +340,8 @@ prometheus_available: node['monitoring']['prometheus']['enable'] || !node['gitlab']['gitlab_rails']['prometheus_address'].nil?, prometheus_server_address: node['gitlab']['gitlab_rails']['prometheus_address'] || node['monitoring']['prometheus']['listen_address'], consul_api_url: node['consul']['enable'] ? consul_helper.api_url : nil, - mailroom_internal_api_url: mailroom_helper.internal_api_url + mailroom_internal_api_url: mailroom_helper.internal_api_url, + has_jh_cookbook: has_jh_cookbook ) ) dependent_services.each { |svc| notifies :restart, svc } diff --git a/files/gitlab-cookbooks/gitlab/templates/default/gitlab.yml.erb b/files/gitlab-cookbooks/gitlab/templates/default/gitlab.yml.erb index 6b42f559a066fd2b501c45d28bef8bdea4437338_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9naXRsYWIvdGVtcGxhdGVzL2RlZmF1bHQvZ2l0bGFiLnltbC5lcmI=..54ae36c68cc351b3b1db1aacad4b64f2ea5c0a2c_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9naXRsYWIvdGVtcGxhdGVzL2RlZmF1bHQvZ2l0bGFiLnltbC5lcmI= 100644 --- a/files/gitlab-cookbooks/gitlab/templates/default/gitlab.yml.erb +++ b/files/gitlab-cookbooks/gitlab/templates/default/gitlab.yml.erb @@ -1127,6 +1127,13 @@ git_basic_auth: <%= @rack_attack_git_basic_auth.to_json if @rack_attack_git_basic_auth %> +<% if @has_jh_cookbook %> + # + # 6. JH only settings + # ========================== +<%= render 'gitlab.yml.jh-partial.erb', :cookbook => 'gitlab-jh' %> +<% end %> + development: <<: *base diff --git a/lib/gitlab/build/check.rb b/lib/gitlab/build/check.rb index 6b42f559a066fd2b501c45d28bef8bdea4437338_bGliL2dpdGxhYi9idWlsZC9jaGVjay5yYg==..54ae36c68cc351b3b1db1aacad4b64f2ea5c0a2c_bGliL2dpdGxhYi9idWlsZC9jaGVjay5yYg== 100644 --- a/lib/gitlab/build/check.rb +++ b/lib/gitlab/build/check.rb @@ -12,4 +12,10 @@ is_auto_deploy? end + def is_jh? + Gitlab::Util.get_env('jh') == 'true' || \ + Gitlab::Util.get_env('GITLAB_VERSION')&.end_with?('-jh') || \ + File.read('VERSION').strip.end_with?('-jh') + end + def include_ee? @@ -15,5 +21,5 @@ def include_ee? - is_ee? + is_ee? || is_jh? end def fips?