Commit e6b926f1 authored by Kirill Smelkov's avatar Kirill Smelkov

X on setting up DB first time / migrations on upgrade

parent 3b899791
+ remove ssh access, "You won't be able to pull or push ..." warning + remove ssh access, "You won't be able to pull or push ..." warning
- disable ssh keys management (so gitlab does not mess with webrunner keys) ? - disable ssh keys management (so gitlab does not mess with webrunner keys) ?
~ remove `sudo ...` (or fake it)
~ gitlab.yml: git -> bin_path
- setup basic ~/.gitconfig - setup basic ~/.gitconfig
- pull request with 1 patch -> merge fast-forward - pull request with 1 patch -> merge fast-forward
- unicorn.rb + other configs (check vs omnibus)
- default project limit setting: 10 -> 50 - default project limit setting: 10 -> 50
- integrate git-backup in a PBS-style way - integrate git-backup in a PBS-style way
? mail server (for email notifications)
+ it has bug with exim (https://github.com/gitlabhq/gitlabhq/issues/4866)
? `bundle exec rails console` exit/fails silently
http://localhost:3000/help/security/reset_root_password.md
? No effect after changing extra:sign_in_text (in gitlab.yml) and restarting gitlab foreman ? No effect after changing extra:sign_in_text (in gitlab.yml) and restarting gitlab foreman
http://localhost:3000/help/customization/welcome_message.md http://localhost:3000/help/customization/welcome_message.md
...@@ -26,10 +16,11 @@ NOTES ...@@ -26,10 +16,11 @@ NOTES
https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md
bundle exec rake <task> RAILS_ENV=production gitlab-rake <task>
(list of tasks: `rake -T` or `rake -D`) (list of tasks: `rake -T` or `rake -D`)
(see doc/raketasks/*) (see doc/raketasks/*)
gitlab:check gitlab:check
gitlab:*:check -> promise
gitlab:env:info gitlab:env:info
gitlab:import:repos gitlab:import:repos
...@@ -37,8 +28,6 @@ gitlab:setup ...@@ -37,8 +28,6 @@ gitlab:setup
gitlab:shell:install gitlab:shell:install
gitlab:shell:setup gitlab:shell:setup
gitlab:sidekiq:*
gitlab:web_hook:{add,rm,list} gitlab:web_hook:{add,rm,list}
gitlab:test gitlab:test
......
...@@ -30,7 +30,7 @@ parts = ...@@ -30,7 +30,7 @@ parts =
service-postgresql service-postgresql
service-redis service-redis
# instance-setup-firsttime instance-setup
instance-upgrade instance-upgrade
# std stuff for slapos instance # std stuff for slapos instance
...@@ -386,7 +386,6 @@ ipv6-random = ...@@ -386,7 +386,6 @@ ipv6-random =
port = port =
############# #############
# Redis # # Redis #
############# #############
...@@ -533,24 +532,49 @@ depend = ${nginx-symlinks:symlink} ...@@ -533,24 +532,49 @@ depend = ${nginx-symlinks:symlink}
# 5. instance setup / upgrade # 5. instance setup / upgrade
# TODO # FIXME for both instance-setup and instance-upgrade to run ok postgresql &
#[instance-setup-firsttime] # redis must be running. how to make sure to start them? `xslapos node restart
# slappart0:postgresql-on-watch` ?
[on-reinstantiate]
recipe = plone.recipe.command
stop-on-error = true
rake = ${gitlab-rake:wrapper-path}
# run command on every reinstantiation
update-command = ${:command}
# what to do when instance is initially setup
# see
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/recipes/database_migrations.rb
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/recipes/postgresql.rb
[instance-setup]
<= on-reinstantiate
command =
if {{ postgresql_location }}/bin/psql \
-h ${service-postgresql:pgdata-directory} \
-U ${service-postgresql:superuser} \
-d ${service-postgresql:dbname} \
-c '\d' | grep -q '^No relations found' ; then
${:rake} db:schema:load db:seed_fu
fi
# what to do when instance is upgraded # what to do when instance is upgraded
# see # see
# https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/support/deploy/deploy.sh # https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/support/deploy/deploy.sh
# https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/gitlab/upgrader.rb # https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/gitlab/upgrader.rb
# TODO omnibus -> files/gitlab-cookbooks/gitlab/recipes/gitlab-rails.rb ? # https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/recipes/gitlab-rails.rb
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-ctl-commands/upgrade.rb
[upgrade-dir] [upgrade-dir]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
log = ${directory:log}/upgrade log = ${directory:log}/upgrade
# XXX run db:migrate only if version changed ? # XXX run db:migrate only if version changed ?
[instance-upgrade] [instance-upgrade]
recipe = plone.recipe.command <= on-reinstantiate
stop-on-error = true
rake = ${gitlab-rake:wrapper-path}
command = command =
# XXX | tee breaks exit code check
${:rake} db:migrate 2>&1 | tee ${upgrade-dir:log}/db-mirate-`date +%s`.log && ${:rake} db:migrate 2>&1 | tee ${upgrade-dir:log}/db-mirate-`date +%s`.log &&
${:rake} assets:clean && ${:rake} assets:clean &&
${:rake} assets:precompile && ${:rake} assets:precompile &&
......
...@@ -76,7 +76,7 @@ git-executable = ${git:location}/bin/git ...@@ -76,7 +76,7 @@ git-executable = ${git:location}/bin/git
recipe = zc.recipe.egg:develop recipe = zc.recipe.egg:develop
#setup = ${slapos.cookbook-repository:location} #setup = ${slapos.cookbook-repository:location}
# XXX hack # XXX hack
setup = /srv/slapgrid/slappart16/srv/runner/project/slapos setup = /srv/slapgrid/slappart14/srv/runner/project/slapos
# Install slapos.cookbook containing all officials recipes # Install slapos.cookbook containing all officials recipes
# Explicitely define dependencies as well, because of buildout limitation # Explicitely define dependencies as well, because of buildout limitation
......
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