Commit 2d17ae03 authored by Kirill Smelkov's avatar Kirill Smelkov

X gitlab-shell talks to unicorn via socket

parent 214d6910
......@@ -267,56 +267,62 @@ prog = {{ prog }}
# 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]
[root-shadow]
recipe = plone.recipe.command
stop-on-error = yes
location = ${directory:home}/${:_buildout_section_name_}
command =
{{ git }} clone {{ gitlab_repository_location }} ${:location} &&
cd ${:location} &&
{{ git }} init ${:location} &&
cd ${:location} &&
{{ git }} remote add software ${:software} &&
${:update-command}
update-command =
cd ${:location} &&
{{ git }} fetch software &&
{{ git }} reset --hard `cd ${:software} && {{ git }} rev-parse HEAD` &&
${:relink-command}
[gitlab-root-shadow]
<= root-shadow
software = {{ gitlab_repository_location }}
relink-command =
# secret* tmp/ log/
rm -f .secret .gitlab_shell_secret &&
rm -rf log tmp &&
ln -s ${gitlab:etc}/secret .secret &&
ln -sf ${gitlab:etc}/secret .secret &&
touch ${gitlab-shell:etc}/gitlab_shell_secret &&
ln -s ${gitlab-shell:etc}/gitlab_shell_secret .gitlab_shell_secret &&
ln -s ${gitlab:log} log &&
ln -s ${gitlab:tmp} tmp &&
ln -sf ${gitlab-shell:etc}/gitlab_shell_secret .gitlab_shell_secret &&
ln -sf ${gitlab:log} log &&
ln -sf ${gitlab:tmp} tmp &&
# config/
cd config &&
ln -s ${unicorn.rb:rendered} unicorn.rb &&
ln -s ${gitlab.yml:rendered} gitlab.yml &&
ln -s ${database.yml:rendered} database.yml &&
ln -s ${resque.yml:rendered} resque.yml &&
ln -sf ${unicorn.rb:rendered} unicorn.rb &&
ln -sf ${gitlab.yml:rendered} gitlab.yml &&
ln -sf ${database.yml:rendered} database.yml &&
ln -sf ${resque.yml:rendered} resque.yml &&
# config/initializers/
cd initializers &&
ln -s ${rack_attack.rb:rendered} rack_attack.rb &&
ln -s ${smtp_settings.rb:rendered} smtp_settings.rb &&
ln -sf ${rack_attack.rb:rendered} rack_attack.rb &&
ln -sf ${smtp_settings.rb:rendered} smtp_settings.rb &&
# public/
cd ../../public &&
rm -rf uploads &&
ln -s ${gitlab:uploads} uploads &&
ln -sf ${gitlab:uploads} uploads &&
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}
<= root-shadow
software = {{ gitlab_shell_repository_location }}
relink-commands =
cd ${:location} &&
ln -s ${gitlab-shell-config.yml:rendered} config.yml &&
ln -s ${gitlab-shell:etc}/gitlab_shell_secret .gitlab_shell_secret &&
relink-command =
ln -sf ${gitlab-shell-config.yml:rendered} config.yml &&
ln -sf ${gitlab-shell:etc}/gitlab_shell_secret .gitlab_shell_secret &&
true
......
......@@ -8,7 +8,8 @@
user: {{ gitlab_backend.user }}
# Url to gitlab instance. Used for api calls. Should end with a slash.
gitlab_url: "http+unix://{{ urllib.quote_plus(unicorn.socket) }}X/"
gitlab_url: "http+unix://{{ urllib.quote_plus(unicorn.socket) }}"
#gitlab_url: "http://127.0.0.1:8888"
http_settings:
{# we don't need any
......
......@@ -10,6 +10,7 @@
# What ports/sockets to listen on, and what options for them.
# we listen only on unix socket
listen "{{ unicorn.socket }}", :backlog => {{ cfg('unicorn_backlog_socket') }}
#listen "127.0.0.1:8888", :tcp_nopush => true
working_directory '{{ gitlab_root_shadow.location }}'
......
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