Commit 71565a2c authored by Kirill Smelkov's avatar Kirill Smelkov

X Nginx instance dirs layout settled

parent bae28dd8
......@@ -67,6 +67,7 @@ recipe = slapos.cookbook:publish
url = ${gitlab-backend:url}
# TODO reintegrate postgresql/redis into this instance
#################################
# need: PostgreSQL instance #
#################################
......@@ -95,7 +96,6 @@ software-url = {{ urlparse.urljoin(software_release_url, '../redis-server/softwa
return = redis_ip redis_port
# TODO need: Nginx instance
#############################
......@@ -110,6 +110,7 @@ bin = ${:home}/bin
etc = ${:home}/etc
var = ${:home}/var
log = ${:var}/log
run = ${:var}/run
srv = ${:home}/srv
# slapos startup/service/promies scripts live here:
startup = ${:etc}/run
......@@ -123,6 +124,8 @@ promise = ${:etc}/promise
recipe = slapos.cookbook:mkdirectory
etc = ${directory:etc}/gitlab
log = ${directory:log}/gitlab
# XXX questionable from now on?
var = ${directory:var}/gitlab
tmp = ${:var}/tmp
uploads = ${:var}/uploads
......@@ -140,12 +143,16 @@ etc = ${directory:etc}/gitlab-shell
# 2. configuration files
[gitlab-etc-template]
[etc-template]
recipe = slapos.recipe.template:jinja2
extensions = jinja2.ext.do
rendered= ${gitlab:etc}/${:_buildout_section_name_}
mode = 0640
[gitlab-etc-template]
<= etc-template
rendered= ${gitlab:etc}/${:_buildout_section_name_}
[database.yml]
<= gitlab-etc-template
template= {{ database_yml_in }}
......@@ -160,14 +167,12 @@ context =
section gitlab_backend gitlab-backend
section instance_parameter instance-parameter
[resque.yml]
<= gitlab-etc-template
template= {{ resque_yml_in }}
context =
section redis request-redis
[smtp_settings.rb]
<= gitlab-etc-template
template= {{ smtp_settings_rb_in }}
......@@ -180,19 +185,23 @@ template = {{ rack_attack_rb_in }}
context =
section instance_parameter instance-parameter
# XXX move to own directory?
[nginx-etc-template]
<= etc-template
rendered= ${nginx:etc}/${:_buildout_section_name_}
[nginx.conf]
<= gitlab-etc-template
<= nginx-etc-template
template= {{ nginx_conf_in }}
context =
section instance_parameter instance-parameter
section gitlab_backend gitlab-backend
section directory directory
raw mime_types {{ mime_types }}
# raw nginx_gitlab_http_conf ${nginx-gitlab-http.conf:rendered}
[nginx-gitlab-http.conf]
<= gitlab-etc-template
<= nginx-etc-template
template= {{ nginx_gitlab_http_conf_in }}
context = ...
......@@ -309,17 +318,25 @@ command =
# sidekiq
# nginx: etc/ log/ ...
[xnginx]
######################
# Nginx frontend #
######################
# srv/nginx/ prefix + etc/ log/ ...
[nginx]
recipe = slapos.cookbook:mkdirectory
srv = ${directory:srv}/nginx
etc = ${directory:etc}/nginx
log = ${directory:log}/nginx
# TODO more?
[nginx-symlinks]
# (nginx wants <prefix>/logs to be there from start - else it issues alarm to the log)
recipe = cns.recipe.symlink
symlink = ${nginx:log} = ${nginx:srv}/logs
# nginx frontend
[service-nginx]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:service}/nginx
#command-line = {{ nginx }} -p ... -c ${nginx.conf:rendered}
command-line = {{ nginx }} -p ${directory:home} -c ${nginx.conf:rendered}
command-line = {{ nginx_bin }} -p ${nginx:srv} -c ${nginx.conf:rendered}
depend = ${nginx-symlinks:symlink}
# GitLab "switch-softwaretype" instance
# TODO write why we still use switch-softwaretype, if we only have 1 -gitlab softwaretype
[buildout]
parts = switch-softwaretype
......@@ -31,7 +32,7 @@ context =
raw gitlab_repository_location ${gitlab-repository:location}
raw bundler_4gitlab ${bundler-4gitlab:bundle}
raw git ${git:location}/bin/git
raw nginx ${nginx-output:nginx}
raw nginx_bin ${nginx-output:nginx}
raw mime_types ${nginx-output:mime}
raw gitlab_parameters_cfg ${gitlab-parameters.cfg:target}
......
......@@ -157,7 +157,9 @@ make-targets= cd ${:path} &&
# eggs for instance.cfg
[eggs]
recipe = zc.recipe.egg
eggs = plone.recipe.command
eggs =
plone.recipe.command
cns.recipe.symlink
[instance.cfg]
......@@ -228,3 +230,4 @@ url = ${:_profile_base_location_}/template/${:_buildout_section_name_}
rubygemsrecipe = 0.2.2
plone.recipe.command = 1.1
slapos.recipe.template = 2.8
cns.recipe.symlink = 0.2.3
......@@ -13,7 +13,7 @@
worker_processes {{ cfg('nginx_worker_processes') }};
error_log stderr;
pid nginx.pid;
pid {{ directory.run }}/nginx.pid;
daemon off;
......
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