Commit 214d6910 authored by Kirill Smelkov's avatar Kirill Smelkov

X Debugging gitlab-shell -> unicorn link

parent 73e1783a
......@@ -17,6 +17,7 @@ parts =
{% endfor %}
gitlab-root-shadow
gitlab-shell-root-shadow
service-gitlab-workhorse
service-unicorn
......@@ -56,6 +57,7 @@ configuration.nginx_worker_processes = {{ multiprocessing.cpu_count() }}
# for convenience
# XXX place ok? naming?
# XXX rename -> backend-info ?
[gitlab-backend]
host = ${instance-parameter:ipv6-random}
port = 7777
......@@ -66,7 +68,7 @@ url = http://[${:host}]:${:port}
user = {{ pwd.getpwuid(os.getuid())[0] }}
# XXX hack
gitlab-shell = {{ gitlab_shell }}
#gitlab-shell = {{ gitlab_shell }}
git = {{ git }}
......@@ -111,10 +113,11 @@ repositories = ${directory:srv}/repositories
backup = ${directory:srv}/backup
# gitlab-shell: etc/
# gitlab-shell: etc/ log/
[gitlab-shell]
recipe = slapos.cookbook:mkdirectory
etc = ${directory:etc}/gitlab-shell
log = ${directory:log}/gitlab-shell
......@@ -151,8 +154,9 @@ context-extra =
<= gitlab-etc-template
template= {{ gitlab_yml_in }}
context-extra =
section gitlab gitlab
section gitlab_backend gitlab-backend
section gitlab gitlab
section gitlab_backend gitlab-backend
section gitlab_shell_root_shadow gitlab-shell-root-shadow
[resque.yml]
<= gitlab-etc-template
......@@ -182,8 +186,13 @@ context-extra =
template= {{ gitlab_shell_config_yml_in }}
rendered= ${gitlab-shell:etc}/config.yml
context-extra =
section gitlab gitlab
section gitlab_backend gitlab-backend
import urllib urllib
section gitlab gitlab
section gitlab_shell gitlab-shell
section gitlab_backend gitlab-backend
section unicorn unicorn
section service_redis service-redis
raw redis_bin {{ redis_bin }}
[nginx-etc-template]
......@@ -257,6 +266,7 @@ prog = {{ prog }}
# and we can reuse SR.
# XXX run second time after first error try? (mkdir fails)
# XXX naming
# XXX better do such tricks with bind mounting, but that requires user namespaces
[gitlab-root-shadow]
recipe = plone.recipe.command
stop-on-error = yes
......@@ -289,6 +299,26 @@ command =
true
# ----//---- for gitlab-shell
# XXX move common to common?
[gitlab-shell-root-shadow]
recipe = plone.recipe.command
stop-on-error = yes
location = ${directory:home}/${:_buildout_section_name_}
command =
{{ git }} clone {{ gitlab_shell_repository_location }} ${:location} &&
${:relink-commands}
update-command =
{{ git }} pull origin &&
${:relink-commands}
relink-commands =
cd ${:location} &&
ln -s ${gitlab-shell-config.yml:rendered} config.yml &&
ln -s ${gitlab-shell:etc}/gitlab_shell_secret .gitlab_shell_secret &&
true
# etc/
......
......@@ -24,12 +24,12 @@ rendered= $${buildout:directory}/instance-gitlab.cfg
context =
import os os
import pwd pwd
import urlparse urlparse
import multiprocessing multiprocessing
key eggs_directory buildout:eggs-directory
key develop_eggs_directory buildout:develop-eggs-directory
key software_release_url slap-connection:software-release-url
raw gitlab_repository_location ${gitlab-repository:location}
raw gitlab_repository_location ${gitlab-repository:location}
raw gitlab_shell_repository_location ${gitlab-shell-repository:location}
raw bundler_4gitlab ${bundler-4gitlab:bundle}
raw gitlab_workhorse ${gitlab-workhorse:location}/gitlab-workhorse
raw git ${git:location}/bin/git
......
......@@ -8,8 +8,7 @@
user: {{ gitlab_backend.user }}
# Url to gitlab instance. Used for api calls. Should end with a slash.
# TODO urlencode
gitlab_url: "http+unix://{{ unicorn.socket }}/"
gitlab_url: "http+unix://{{ urllib.quote_plus(unicorn.socket) }}X/"
http_settings:
{# we don't need any
......@@ -33,10 +32,10 @@ auth_file: "TODO"
# Redis settings used for pushing commit notices to gitlab
redis:
bin: {{ redis.bin }}/redis-cli
host: {{ redis_service.ipv6 }} {# XXX not specify at all ? #}
port: {{ redis_service.port }} {# XXX not specify at all ? #}
socket: {{ redis_service.unixsocket }}
bin: {{ redis_bin }}/redis-cli
host: {{ service_redis.ipv6 }} {# XXX not specify at all ? #}
port: {{ service_redis.port }} {# XXX not specify at all ? #}
socket: {{ service_redis.unixsocket }}
{# we don't use password for redis
<% if @redis_password %>
pass: <%= @redis_password %>
......
......@@ -102,10 +102,10 @@ production: &base
## GitLab Shell settings
gitlab_shell:
path: {{ gitlab_backend['gitlab-shell'] }}
path: {{ gitlab_shell_root_shadow.location }}
repos_path: {{ gitlab.repositories }}
hooks_path: {{ gitlab_backend['gitlab-shell'] }}/hooks/
hooks_path: {{ gitlab_shell_root_shadow.location }}/hooks/
# Git over HTTP is enabled
upload_pack: true
......
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