Commit f0ac1f96 authored by Kirill Smelkov's avatar Kirill Smelkov

X I can start rails app manually, but 500 because redis is not yet there

parent d3666828
......@@ -3,7 +3,7 @@
partition_forinst() {
# 2015-06-12 12:08:48 slapos[5354] INFO slappart3 slaprunner busy /srv/slapgrid/slappart16/srv/runner/project/slapos/software/gitlab/software.cfg RootSoftwareInstance gitlab1 - started
# gitlab1 -> slappart3
xslapos proxy show 2>&1 | grep -w $1 | awk '{print $5}'
xslapos proxy show --partitions 2>&1 | grep -w $1 | awk '{print $5}'
}
xslapos node software -v --only-sr `pwd`/software.cfg --pidfile $HOME/var/run/slapgrid-sr.pid && \
......
......@@ -4,12 +4,15 @@
parts =
directory
# promise TODO
# publish-connection-parameters
publish-instance-info
# request-postgresql
gitlab-rails
gitlab-rake
gitlab-unicorn
gitlab-sidekiq
gitlab-root-shadow
# std stuff for slapos instance
......@@ -19,6 +22,31 @@ offline = true
[instance-parameter]
# std stuff to fetch slapos instance parameters
recipe = slapos.cookbook:slapconfiguration
computer= ${slap-connection:computer-id}
partition=${slap-connection:partition-id}
url = ${slap-connection:server-url}
key = ${slap-connection:key-file}
cert = ${slap-connection:cert-file}
# gitlab instance parameters
configuration.name = XXX
# for convenience
[gitlab-backend]
host = ${instance-parameter:ipv6-random}
port = 7777
url = http://[${:host}]:${:port}
[publish-instance-info]
recipe = slapos.cookbook:publish
url = ${gitlab-backend:url}
[request-postgresql]
<= slap-connection
recipe = slapos.cookbook:request
......@@ -54,14 +82,30 @@ recipe = slapos.cookbook:mkdirectory
etc = ${directory:etc}/gitlab
log = ${directory:log}/gitlab
var = ${directory:var}/gitlab
tmp = ${:var}/tmp
uploads = ${:var}/uploads
# gitlab-shell: etc/
[gitlab-shell]
recipe = slapos.cookbook:mkdirectory
etc = ${directory:etc}/gitlab-shell
[gitlab-database.yml]
recipe = slapos.recipe.template
url = {{ database_yml_in }}
output = ${gitlab:etc}/database.yml
# FIXME aaa should not be here
aaa = ${request-postgresql:connection-url}
[gitlab.yml]
recipe = slapos.recipe.template
url = {{ gitlab_yml_in }}
output = ${gitlab:etc}/gitlab.yml
# TODO log: logrotate
......@@ -69,6 +113,8 @@ aaa = ${request-postgresql:connection-url}
# bin/
# gitlab-rails
# gitlab-rake
# ? gitlab-unicorn
# ? gitlab-sidekiq
[gitlab-bin]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:bin}/${:_buildout_section_name_}
......@@ -93,6 +139,25 @@ command-line =
{{ bundler_4gitlab }} exec sh -c
'cd ${gitlab-root-shadow:location} && rake "$@"' rake
[gitlab-unicorn]
<= gitlab-bin
# NOTE sys.argv[1:] implicityly appended
command-line =
{{ bundler_4gitlab }} exec sh -c
'cd ${gitlab-root-shadow:location} && unicorn "$@"' unicorn
[gitlab-sidekiq]
<= gitlab-bin
# NOTE sys.argv[1:] implicityly appended
command-line =
{{ bundler_4gitlab }} exec sh -c
'cd ${gitlab-root-shadow:location} && sidekiq "$@"' sidekiq
# # TODO -> service/
# [gitlab-unicorn]
# <= gitlab-bin
# Gitlab/Rails operation is tighted that config/ lives inside code.
# to have ability to create several instances configured differently from 1 SR.
......@@ -122,13 +187,14 @@ command =
rm -f .secret .gitlab_shell_secret &&
rm -rf log tmp &&
ln -s ${gitlab:etc}/secret .secret &&
ln -s AAA/.gitlab_shell_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:var}/tmp . &&
ln -s ${gitlab:tmp} tmp &&
# config/
cd config &&
ln -s ${gitlab:etc}/unicorn.rb . &&
ln -s ${gitlab:etc}/gitlab.yml . &&
ln -s ${gitlab.yml:output} gitlab.yml &&
ln -s ${gitlab-database.yml:output} database.yml &&
ln -s ${gitlab:etc}/resque.yml . &&
# config/initializers/
......@@ -138,43 +204,11 @@ command =
# public/
cd ../../public &&
rm -rf uploads &&
ln -s ${gitlab:var}/uploads . &&
ln -s ${gitlab:uploads} uploads &&
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/
......
......@@ -24,6 +24,7 @@ context =
raw git ${git:location}/bin/git
raw database_yml_in ${database.yml.in:target}
raw gitlab_yml_in ${gitlab.yml.in:target}
[switch-softwaretype]
......
......@@ -180,12 +180,20 @@ destination = ${buildout:directory}/instance-gitlab.cfg.in
# TODO parts/database.yml.in/database.yml.in -> parts/database.yml.in
[database.yml.in]
[download-template]
recipe = slapos.recipe.download
download-only = true
url = ${:_profile_base_location_}/template/${:_buildout_section_name_}
[database.yml.in]
<= download-template
# TODO md5sum
[gitlab.yml.in]
<= download-template
# TODO md5sum
# [buildout]
# gems-directory = gemsAAA # XXX = good idea?
......
......@@ -9,8 +9,8 @@ production:
#database: gitlabhq_production
database: ${postgresql-urlparse:path}
pool: 10
username: ${postgresql-urlparse:username}
password: ${postgresql-urlparse:password}
username: '${postgresql-urlparse:username}'
password: '${postgresql-urlparse:password}'
host: ${postgresql-urlparse:host}
port: ${postgresql-urlparse:port}
# socket:
# @autogenerated XXX
# see:
# https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/gitlab.yml.example
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/gitlab.yml.erb
production: &base
#
# 1. GitLab app settings
# ==========================
## GitLab settings
gitlab:
## Web server settings (note: host is the FQDN, do not include http://)
host: ${gitlab-backend:host}
port: ${gitlab-backend:port}
# TODO
#https: <%= @gitlab_https %>
https: false
# TODO
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