Allow to override settings when executing the worker in --seed mode

pull/7154/head
Cyril Rohr 6 years ago
parent 4f3aacd5d7
commit cbd2c93bb7
  1. 42
      config/database.docker.yml
  2. 2
      docker-compose.pullpreview.yml
  3. 6
      docker/worker

@ -1,42 +0,0 @@
#-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2018 the OpenProject Foundation (OPF)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
# Copyright (C) 2006-2017 Jean-Philippe Lang
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See docs/COPYRIGHT.rdoc for more details.
#++
development: &mysql
adapter: mysql2
database: openproject_development
host: db
username: root
password:
encoding: utf8
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *mysql
database: openproject_test

@ -39,7 +39,7 @@ worker:
- "RAILS_ENV=production"
- "HEROKU=true"
- "OP_ADMIN_USER_SEEDER_FORCE_PASSWORD_CHANGE=off"
command: "./docker/worker --seed"
command: "./docker/worker --seed --set attachment_max_size=262144"
memory: 384
volumes_from:
- web

@ -2,6 +2,12 @@
if [ "$1" = "--seed" ]; then
shift
echo "Executing database migration and database seed..."
bundle exec rake db:migrate db:seed
if [ "$1" = "--set" ]; then
shift
echo "Update application settings..."
bundle exec rake setting:set["$@"]
fi
fi
exec bundle exec rake jobs:work

Loading…
Cancel
Save