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 }} ...@@ -267,56 +267,62 @@ prog = {{ prog }}
# XXX run second time after first error try? (mkdir fails) # XXX run second time after first error try? (mkdir fails)
# XXX naming # XXX naming
# XXX better do such tricks with bind mounting, but that requires user namespaces # XXX better do such tricks with bind mounting, but that requires user namespaces
[gitlab-root-shadow]
[root-shadow]
recipe = plone.recipe.command recipe = plone.recipe.command
stop-on-error = yes stop-on-error = yes
location = ${directory:home}/${:_buildout_section_name_} location = ${directory:home}/${:_buildout_section_name_}
command = command =
{{ git }} clone {{ gitlab_repository_location }} ${:location} && {{ git }} init ${:location} &&
cd ${: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/ # secret* tmp/ log/
rm -f .secret .gitlab_shell_secret && rm -f .secret .gitlab_shell_secret &&
rm -rf log tmp && rm -rf log tmp &&
ln -s ${gitlab:etc}/secret .secret && ln -sf ${gitlab:etc}/secret .secret &&
touch ${gitlab-shell:etc}/gitlab_shell_secret && touch ${gitlab-shell:etc}/gitlab_shell_secret &&
ln -s ${gitlab-shell:etc}/gitlab_shell_secret .gitlab_shell_secret && ln -sf ${gitlab-shell:etc}/gitlab_shell_secret .gitlab_shell_secret &&
ln -s ${gitlab:log} log && ln -sf ${gitlab:log} log &&
ln -s ${gitlab:tmp} tmp && ln -sf ${gitlab:tmp} tmp &&
# config/ # config/
cd config && cd config &&
ln -s ${unicorn.rb:rendered} unicorn.rb && ln -sf ${unicorn.rb:rendered} unicorn.rb &&
ln -s ${gitlab.yml:rendered} gitlab.yml && ln -sf ${gitlab.yml:rendered} gitlab.yml &&
ln -s ${database.yml:rendered} database.yml && ln -sf ${database.yml:rendered} database.yml &&
ln -s ${resque.yml:rendered} resque.yml && ln -sf ${resque.yml:rendered} resque.yml &&
# config/initializers/ # config/initializers/
cd initializers && cd initializers &&
ln -s ${rack_attack.rb:rendered} rack_attack.rb && ln -sf ${rack_attack.rb:rendered} rack_attack.rb &&
ln -s ${smtp_settings.rb:rendered} smtp_settings.rb && ln -sf ${smtp_settings.rb:rendered} smtp_settings.rb &&
# public/ # public/
cd ../../public && cd ../../public &&
rm -rf uploads && rm -rf uploads &&
ln -s ${gitlab:uploads} uploads && ln -sf ${gitlab:uploads} uploads &&
true true
# ----//---- for gitlab-shell # ----//---- for gitlab-shell
# XXX move common to common?
[gitlab-shell-root-shadow] [gitlab-shell-root-shadow]
recipe = plone.recipe.command <= root-shadow
stop-on-error = yes software = {{ gitlab_shell_repository_location }}
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 = relink-command =
cd ${:location} && ln -sf ${gitlab-shell-config.yml:rendered} config.yml &&
ln -s ${gitlab-shell-config.yml:rendered} config.yml && ln -sf ${gitlab-shell:etc}/gitlab_shell_secret .gitlab_shell_secret &&
ln -s ${gitlab-shell:etc}/gitlab_shell_secret .gitlab_shell_secret &&
true true
......
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
user: {{ gitlab_backend.user }} user: {{ gitlab_backend.user }}
# Url to gitlab instance. Used for api calls. Should end with a slash. # 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: http_settings:
{# we don't need any {# we don't need any
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
# What ports/sockets to listen on, and what options for them. # What ports/sockets to listen on, and what options for them.
# we listen only on unix socket # we listen only on unix socket
listen "{{ unicorn.socket }}", :backlog => {{ cfg('unicorn_backlog_socket') }} listen "{{ unicorn.socket }}", :backlog => {{ cfg('unicorn_backlog_socket') }}
#listen "127.0.0.1:8888", :tcp_nopush => true
working_directory '{{ gitlab_root_shadow.location }}' 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