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

X Took decision to build shadow gitlab root per instance

parent 82b91ce8
......@@ -47,3 +47,23 @@ db:migrate
Useful to understand:
https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/architecture.md
~~~~
per instance
.secret
.gitlab_shell_secret
log/
tmp/
public/uploads/
config/
resque.yml
gitlab.yml
database.yml
initializers/
rack_attack.rb
smtp_settings.rb
XXX what about unicorn.rb ? <- no need to link (not under rails)
......@@ -9,6 +9,7 @@ parts =
gitlab-rails
gitlab-rake
gitlab-root-shadow
# std stuff for slapos instance
eggs-directory = ${buildout:eggs-directory}
......@@ -61,6 +62,52 @@ command-line = ${bundler-4gitlab:bundle} exec rails
command-line = ${bundler-4gitlab:bundle} exec rake
# Gitlab/Rails operation is tighted that config/ lives inside code.
# 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.
#
# This way Gitlab/Rails still think they work in 1 code / 1 instance way,
# and we can reuse SR.
# XXX run second time after first error try? (mkdir fails)
[gitlab-root-shadow]
recipe = plone.recipe.command
stop-on-error = yes
location = $${directory:home}/$${:_buildout_section_name_}
command =
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 AAA/.secret . &&
ln -s AAA/.gitlab_shell_secret . &&
ln -s $${directory:log}/gitlab log &&
ln -s AAA/tmp . &&
# config/
rm config && mkdir config && cd config &&
for i in ${gitlab-repository:location}/config/* ; do ln -s $i ; done &&
ln -s AAA/unicorn.rb . &&
ln -s AAA/gitlab.yml . &&
ln -s AAA/database.yml . &&
ln -s AAA/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 AAA/rack_attack.rb . &&
ln -s AAA/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 $${directory:var}/gitlab-uploads uploads &&
true
# etc/
# service/
......
......@@ -38,11 +38,18 @@ parts =
# for instance
slapos-cookbook
eggs
#extends = https://lab.nexedi.cn/kirr/slapos/raw/master/software/helloworld/software.cfg
#extends = /home/kirr/src/wendelin/slapos/slapos/software/helloworld/software.cfg
# eggs for instance.cfg
[eggs]
recipe = zc.recipe.egg
eggs = plone.recipe.command
[ktest]
recipe = zc.recipe.egg:develop
egg = ktest
......
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