2018-12-03 11:38:01 +00:00
|
|
|
namespace :zammad do
|
|
|
|
|
|
|
|
namespace :ci do
|
|
|
|
|
|
|
|
namespace :test do
|
|
|
|
|
|
|
|
desc 'Prepares Zammad system for CI env'
|
2020-02-18 19:51:31 +00:00
|
|
|
task :prepare, [:elasticsearch] do |_task, args| # rubocop:disable Rails/RakeEnvironment
|
2018-12-03 11:38:01 +00:00
|
|
|
ENV['RAILS_ENV'] ||= 'production'
|
|
|
|
ENV['DISABLE_DATABASE_ENVIRONMENT_CHECK'] = 'true'
|
|
|
|
# we have to enforce the env
|
|
|
|
# otherwise it will fallback to default (develop)
|
|
|
|
Rails.env = ENV['RAILS_ENV']
|
|
|
|
|
|
|
|
Rake::Task['zammad:flush:cache'].invoke
|
|
|
|
|
|
|
|
Rake::Task['zammad:db:init'].invoke
|
|
|
|
|
|
|
|
Rake::Task['zammad:ci:settings'].invoke(args[:elasticsearch])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|