instance.cfg.in 4.1 KB
# GitLab "switch-softwaretype" instance
[buildout]
parts = switch-softwaretype

# std stuff for slapos instance
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true


[switch-softwaretype]
recipe = slapos.cookbook:softwaretype
gitlab  = $${instance-gitlab.cfg:rendered}
gitlab-export   = $${instance-gitlab-export.cfg:rendered}
gitlab-test = $${instance-gitlab-test.cfg:rendered}
default = $${:gitlab}
# TODO -import, -pull-backup


# macro: render instance-*.cfg from instance-*.cfg.in
[instance-cfg]
recipe  = slapos.recipe.template:jinja2
mode    = 0644
rendered= $${buildout:directory}/$${:_buildout_section_name_}
context =
    import os os
    import pwd pwd
    import multiprocessing multiprocessing

    key eggs_directory          buildout:eggs-directory
    key develop_eggs_directory  buildout:develop-eggs-directory
    raw gitlab_repository_location          ${gitlab-repository:location}
    raw gitlab_shell_repository_location    ${gitlab-shell-repository:location}

# program binaries
    raw bash_bin                    ${bash:location}/bin/bash
    raw bzip2_location              ${bzip2:location}
    raw bundler_4gitlab             ${bundler-4gitlab:bundle}
    raw coreutils_location          ${coreutils:location}
    raw curl_bin                    ${curl:location}/bin/curl
    raw dcron_bin                   ${dcron-output:crond}
    raw git                         ${git:location}/bin/git
    raw git_location                ${git:location}
    raw gitlab_export               ${gitlab-export:rendered}
    raw gitlab_workhorse            ${gowork:bin}/gitlab-workhorse
    raw gopath_bin                  ${gowork:bin}
    raw gunzip_bin                  ${gzip:location}/bin/gunzip
    raw grep_location               ${grep:location}
    raw gzip_bin                    ${gzip:location}/bin/gzip
    raw gzip_location               ${gzip:location}
    raw logrotate_bin               ${logrotate:location}/usr/sbin/logrotate
    raw nginx_bin                   ${nginx-output:nginx}
    raw nginx_mime_types            ${nginx-output:mime}
    raw node_bin_location           ${nodejs-8.6.0:location}/bin/
    raw openssl_bin                 ${openssl-output:openssl}
    raw postgresql_location         ${postgresql92:location}
    raw redis_binprefix             ${redis28:location}/bin
    raw ruby_location               ${bundler-4gitlab:ruby-location}
    raw tar_location                ${tar:location}
    raw watcher                     ${watcher:rendered}
    raw xnice_repository_location   ${xnice-repository:location}

# config files
    raw database_yml_in             ${database.yml.in:target}
    raw gitconfig_in                ${gitconfig.in:target}
    raw gitlab_parameters_cfg       ${gitlab-parameters.cfg:target}
    raw gitlab_shell_config_yml_in  ${gitlab-shell-config.yml.in:target}
    raw gitlab_unicorn_startup_in   ${gitlab-unicorn-startup.in:target}
    raw gitlab_yml_in               ${gitlab.yml.in:target}
    raw macrolib_cfg_in             ${macrolib.cfg.in:target}
    raw nginx_conf_in               ${nginx.conf.in:target}
    raw nginx_gitlab_http_conf_in   ${nginx-gitlab-http.conf.in:target}
    raw rack_attack_rb_in           ${rack_attack.rb.in:target}
    raw resque_yml_in               ${resque.yml.in:target}
    raw smtp_settings_rb_in         ${smtp_settings.rb.in:target}
    raw gitlab_restore_sh_in        ${template-gitlab-resiliency-restore.sh.in:target}
    raw unicorn_rb_in               ${unicorn.rb.in:target}

    $${:context-extra}
context-extra =

[instance-gitlab.cfg]
<= instance-cfg
template= ${instance-gitlab.cfg.in:target}

[instance-gitlab-export.cfg]
<= instance-cfg
template= ${instance-gitlab-export.cfg.in:target}
context-extra =
    raw instance_gitlab_cfg         $${instance-gitlab.cfg:rendered}

[instance-gitlab-test.cfg]
<= instance-cfg
template= ${instance-gitlab-test.cfg.in:target}
context-extra =
    raw instance_gitlab_cfg        $${instance-gitlab.cfg:rendered}
    raw instance_gitlab_export_cfg $${instance-gitlab-export.cfg:rendered}
    raw gitlab_demo_backup_path    ${gitlab-demo-backup.git:location}