Commit 628886f1 authored by Kirill Smelkov's avatar Kirill Smelkov

X Move macro to common place

parent 71565a2c
...@@ -147,6 +147,9 @@ etc = ${directory:etc}/gitlab-shell ...@@ -147,6 +147,9 @@ etc = ${directory:etc}/gitlab-shell
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
extensions = jinja2.ext.do extensions = jinja2.ext.do
mode = 0640 mode = 0640
import-list =
rawfile macrolib.cfg.in {{ macrolib_cfg_in }}
# TODO move common context parameters here (= common)
[gitlab-etc-template] [gitlab-etc-template]
......
...@@ -35,6 +35,7 @@ context = ...@@ -35,6 +35,7 @@ context =
raw nginx_bin ${nginx-output:nginx} raw nginx_bin ${nginx-output:nginx}
raw mime_types ${nginx-output:mime} raw mime_types ${nginx-output:mime}
raw macrolib_cfg_in ${macrolib.cfg.in:target}
raw gitlab_parameters_cfg ${gitlab-parameters.cfg:target} raw gitlab_parameters_cfg ${gitlab-parameters.cfg:target}
raw database_yml_in ${database.yml.in:target} raw database_yml_in ${database.yml.in:target}
raw gitlab_yml_in ${gitlab.yml.in:target} raw gitlab_yml_in ${gitlab.yml.in:target}
......
{# common macros for gitlab instance #}
{# cfg(name) -> instance_parameter:configuration.<name> #}
{% macro cfg(name) %}{{ instance_parameter[str("configuration." + name)] }}{% endmacro %}
...@@ -193,6 +193,10 @@ url = ${:_profile_base_location_}/template/${:_buildout_section_name_} ...@@ -193,6 +193,10 @@ url = ${:_profile_base_location_}/template/${:_buildout_section_name_}
<= download-file <= download-file
# md5sum = TODO # md5sum = TODO
[macrolib.cfg.in]
<= download-file
# md5sum = TODO
[database.yml.in] [database.yml.in]
<= download-template <= download-template
# md5sum = TODO # md5sum = TODO
......
...@@ -4,8 +4,7 @@ ...@@ -4,8 +4,7 @@
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/gitlab.yml.erb # https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/gitlab.yml.erb
# (last updated for v7.13.0.rc2) # (last updated for v7.13.0.rc2)
{# cfg(name) -> instance_parameter:configuration.<name> #} {% from 'macrolib.cfg.in' import cfg with context %}
{% macro cfg(name) %}{{ instance_parameter[str("configuration." + name)] }}{% endmacro %}
production: &base production: &base
# #
......
...@@ -4,9 +4,7 @@ ...@@ -4,9 +4,7 @@
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/nginx.conf.erb # https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/nginx.conf.erb
# (last updated for omnibus-gitlab 8.1.0+rc1.ce.0-24-g3021ed9) # (last updated for omnibus-gitlab 8.1.0+rc1.ce.0-24-g3021ed9)
{# cfg(name) -> instance_parameter:configuration.<name> #} {% from 'macrolib.cfg.in' import cfg with context %}
{# XXX dup -> import from gitlab.yml.in ? #}
{% macro cfg(name) %}{{ instance_parameter[str("configuration." + name)] }}{% endmacro %}
# user directive makes sense only when running initially as root (and nginx will complain if not) # user directive makes sense only when running initially as root (and nginx will complain if not)
# user {{ gitlab_backend.user }}; # user {{ gitlab_backend.user }};
......
...@@ -4,9 +4,7 @@ ...@@ -4,9 +4,7 @@
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/rack_attack.rb.erb # https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/rack_attack.rb.erb
# (last updated for omnibus-gitlab 8.1.0+rc1.ce.0-30-g38ef5d7) # (last updated for omnibus-gitlab 8.1.0+rc1.ce.0-30-g38ef5d7)
{# cfg(name) -> instance_parameter:configuration.<name> #} {% from 'macrolib.cfg.in' import cfg with context %}
{# XXX dup -> import from gitlab.yml.in ? #}
{% macro cfg(name) %}{{ instance_parameter[str("configuration." + name)] }}{% endmacro %}
# 1. Rename this file to rack_attack.rb # 1. Rename this file to rack_attack.rb
# 2. Review the paths_to_be_protected and add any other path you need protecting # 2. Review the paths_to_be_protected and add any other path you need protecting
......
...@@ -3,10 +3,7 @@ ...@@ -3,10 +3,7 @@
# https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/initializers/smtp_settings.rb.sample # https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/initializers/smtp_settings.rb.sample
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/smtp_settings.rb.erb # https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/smtp_settings.rb.erb
{# cfg(name) -> instance_parameter:configuration.<name> #} {% from 'macrolib.cfg.in' import cfg with context %}
{# XXX dup -> import from gitlab.yml.in ? #}
{% macro cfg(name) %}{{ instance_parameter[str("configuration." + name)] }}{% endmacro %}
if Rails.env.production? if Rails.env.production?
Gitlab::Application.config.action_mailer.delivery_method = :smtp Gitlab::Application.config.action_mailer.delivery_method = :smtp
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment