Commit b7e21c3fa9d88db8dbfd08e6987637de03703c7b

Authored by Jacob Vosmaer
1 parent 84440be2

Initialize the database after creation

files/gitlab-cookbooks/gitlab/recipes/database_migrations.rb 0 → 100644
... ... @@ -0,0 +1,21 @@
  1 +#
  2 +# Copyright:: Copyright (c) 2014 GitLab.com
  3 +# License:: Apache License, Version 2.0
  4 +#
  5 +# Licensed under the Apache License, Version 2.0 (the "License");
  6 +# you may not use this file except in compliance with the License.
  7 +# You may obtain a copy of the License at
  8 +#
  9 +# http://www.apache.org/licenses/LICENSE-2.0
  10 +#
  11 +# Unless required by applicable law or agreed to in writing, software
  12 +# distributed under the License is distributed on an "AS IS" BASIS,
  13 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14 +# See the License for the specific language governing permissions and
  15 +# limitations under the License.
  16 +#
  17 +
  18 +execute "initialize database" do
  19 + command "/opt/gitlab/bin/gitlab-rake db:schema:load db:seed_fu"
  20 + action :nothing
  21 +end
... ...
files/gitlab-cookbooks/gitlab/recipes/default.rb
... ... @@ -71,3 +71,5 @@ include_recipe "runit"
71 71 include_recipe "gitlab::#{service}_disable"
72 72 end
73 73 end
  74 +
  75 +include_recipe "gitlab:database_migrations"
... ...
files/gitlab-cookbooks/gitlab/recipes/postgresql.rb
... ... @@ -153,5 +153,5 @@ execute "create #{db_name} database" do
153 153 user pg_user
154 154 not_if { !pg_helper.is_running? || pg_helper.database_exists?(db_name) }
155 155 retries 30
156   - # notifies :run, "execute[migrate_database]", :immediately
  156 + notifies :run, "execute[gitlab::initialize database]", :immediately
157 157 end
... ...