Commit c720190f76e4e5c6130d3d917066f83eb7713a6b
Exists in
master
Merge branch 'db_migrate_progress' into 'master'
Log `rake db:migrate` output in /tmp See merge request !196
Showing
3 changed files
with
9 additions
and
3 deletions
Show diff stats
CHANGELOG
... | ... | @@ -6,6 +6,7 @@ omnibus-gitlab repository. |
6 | 6 | 7.3.0 |
7 | 7 | - Add systemd support for Centos 7 |
8 | 8 | - Add a Centos 7 SELinux module for ssh-keygen permissions |
9 | +- Log `rake db:migrate` output in /tmp | |
9 | 10 | |
10 | 11 | 7.2.0 |
11 | 12 | - Pass environment variables to Unicorn and Sidekiq (Chris Portman) | ... | ... |
files/gitlab-cookbooks/gitlab/recipes/database_migrations.rb
... | ... | @@ -20,7 +20,12 @@ execute "initialize database" do |
20 | 20 | action :nothing |
21 | 21 | end |
22 | 22 | |
23 | -execute "migrate database" do | |
24 | - command "/opt/gitlab/bin/gitlab-rake db:migrate" | |
23 | +bash "migrate database" do | |
24 | + code <<-EOH | |
25 | + log_file="/tmp/gitlab-db-migrate-$(date +%s)-$$" | |
26 | + umask 077 | |
27 | + /opt/gitlab/bin/gitlab-rake db:migrate 2>& 1 | tee ${log_file} | |
28 | + exit ${PIPESTATUS[0]} | |
29 | + EOH | |
25 | 30 | action :nothing |
26 | 31 | end | ... | ... |
files/gitlab-cookbooks/gitlab/recipes/gitlab-rails.rb
... | ... | @@ -202,7 +202,7 @@ end |
202 | 202 | # Only run `rake db:migrate` when the gitlab-rails version has changed |
203 | 203 | remote_file File.join(gitlab_rails_dir, 'VERSION') do |
204 | 204 | source "file:///opt/gitlab/embedded/service/gitlab-rails/VERSION" |
205 | - notifies :run, 'execute[migrate database]' unless postgresql_not_listening | |
205 | + notifies :run, 'bash[migrate database]' unless postgresql_not_listening | |
206 | 206 | notifies :run, 'execute[clear the gitlab-rails cache]' unless redis_not_listening |
207 | 207 | dependent_services.each do |sv| |
208 | 208 | notifies :restart, sv | ... | ... |