Commit 4adfb407 authored by Kirill Smelkov's avatar Kirill Smelkov

X Symlinking gitlab-root-shadow does not work

Because ruby determines realpath of imported modules and gitlab / rails use
that as a base in a lot of places.
parent adafde55
...@@ -79,9 +79,18 @@ command-line = ...@@ -79,9 +79,18 @@ command-line =
# Gitlab/Rails operation is tighted that config/ lives inside code. # Gitlab/Rails operation is tighted that config/ lives inside code.
# to have ability to create several instances configured differently from 1 SR, # to have ability to create several instances configured differently from 1 SR.
# we make another Gitlab root symbolically linked to original SR _and_ several #
# configuration files symbolically linked to instance place. # One possibility to overcome this could be to make another Gitlab root
# symbolically linked to original SR _and_ several configuration files
# symbolically linked to instance place. Unfortunately this does not work -
# Ruby determines realpath on module import and Gitlab and Rails lookup config
# files relative to imported modules.
#
# we clone cloned gitlab and add proper links to vendor/bundle and instance
# config files.
# XXX there is no need fo full clone - we only need worktree checkout (a-la git
# worktree add, but without creating files in original clone)
# #
# This way Gitlab/Rails still think they work in 1 code / 1 instance way, # This way Gitlab/Rails still think they work in 1 code / 1 instance way,
# and we can reuse SR. # and we can reuse SR.
...@@ -91,37 +100,64 @@ recipe = plone.recipe.command ...@@ -91,37 +100,64 @@ 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 =
mkdir $${:location} && cd $${:location} && ${git:location}/bin/git clone ${gitlab-repository:location} $${:location} &&
# XXX .[a-z]* - hacky to skip . and .. cd $${:location} &&
for i in ${gitlab-repository:location}/* ${gitlab-repository:location}/.[a-z]* ; do ln -s $i ; done &&
# secret* tmp/ log/ # secret* tmp/ log/
rm -f .secret .gitlab_shell_secret log tmp && rm -f .secret .gitlab_shell_secret &&
rm -rf log tmp &&
ln -s $${gitlab:etc}/secret .secret && ln -s $${gitlab:etc}/secret .secret &&
ln -s AAA/.gitlab_shell_secret . && ln -s AAA/.gitlab_shell_secret . &&
ln -s $${gitlab:log} log && ln -s $${gitlab:log} log &&
ln -s $${gitlab:var}/tmp . && ln -s $${gitlab:var}/tmp . &&
# config/ # config/
rm config && mkdir config && cd config && cd config &&
for i in ${gitlab-repository:location}/config/* ; do ln -s $i ; done &&
ln -s $${gitlab:etc}/unicorn.rb . && ln -s $${gitlab:etc}/unicorn.rb . &&
ln -s $${gitlab:etc}/gitlab.yml . && ln -s $${gitlab:etc}/gitlab.yml . &&
ln -s $${gitlab-database.yml:output} database.yml && ln -s $${gitlab-database.yml:output} database.yml &&
ln -s $${gitlab:etc}/resque.yml . && ln -s $${gitlab:etc}/resque.yml . &&
# config/initializers/ # config/initializers/
rm initializers && mkdir initializers && cd initializers && cd initializers &&
for i in ${gitlab-repository:location}/config/initializers/* ; do ln -s $i ; done &&
ln -s $${gitlab:etc}/rack_attack.rb . && ln -s $${gitlab:etc}/rack_attack.rb . &&
ln -s $${gitlab:etc}/smtp_settings.rb . && ln -s $${gitlab:etc}/smtp_settings.rb . &&
# public/ # public/
cd ../../ && cd ../../public &&
rm public && mkdir public && cd public && rm -rf uploads &&
for i in ${gitlab-repository:location}/public/* ; do ln -s $i ; done &&
rm uploads &&
ln -s $${gitlab:var}/uploads . && ln -s $${gitlab:var}/uploads . &&
true true
# mkdir $${:location} && cd $${:location} &&
# # XXX .[a-z]* - hacky to skip . and ..
# for i in ${gitlab-repository:location}/* ${gitlab-repository:location}/.[a-z]* ; do ln -s $i ; done &&
# # secret* tmp/ log/
# rm -f .secret .gitlab_shell_secret log tmp &&
# ln -s $${gitlab:etc}/secret .secret &&
# ln -s AAA/.gitlab_shell_secret . &&
# ln -s $${gitlab:log} log &&
# ln -s $${gitlab:var}/tmp . &&
# # config/
# rm config && mkdir config && cd config &&
# for i in ${gitlab-repository:location}/config/* ; do ln -s $i ; done &&
# ln -s $${gitlab:etc}/unicorn.rb . &&
# ln -s $${gitlab:etc}/gitlab.yml . &&
# ln -s $${gitlab-database.yml:output} database.yml &&
# ln -s $${gitlab:etc}/resque.yml . &&
# # config/initializers/
# rm initializers && mkdir initializers && cd initializers &&
# for i in ${gitlab-repository:location}/config/initializers/* ; do ln -s $i ; done &&
# ln -s $${gitlab:etc}/rack_attack.rb . &&
# ln -s $${gitlab:etc}/smtp_settings.rb . &&
# # public/
# cd ../../ &&
# rm public && mkdir public && cd public &&
# for i in ${gitlab-repository:location}/public/* ; do ln -s $i ; done &&
# rm uploads &&
# ln -s $${gitlab:var}/uploads . &&
# true
# etc/ # etc/
......
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