2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2018-10-01 17:41:17 +00:00
|
|
|
namespace :zammad do
|
|
|
|
|
|
|
|
namespace :ci do
|
|
|
|
|
|
|
|
namespace :test do
|
|
|
|
|
|
|
|
desc 'Stop of all Zammad services and cleans up the database(s)'
|
2020-02-18 19:51:31 +00:00
|
|
|
task :stop, [:no_app] do |_task, args| # rubocop:disable Rails/RakeEnvironment
|
2018-10-01 17:41:17 +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']
|
|
|
|
|
2018-12-19 14:47:15 +00:00
|
|
|
Rake::Task['zammad:ci:app:stop'].invoke if args[:no_app].blank?
|
2018-10-01 17:41:17 +00:00
|
|
|
Rake::Task['db:drop:all'].invoke
|
|
|
|
|
|
|
|
next if !SearchIndexBackend.enabled?
|
|
|
|
|
|
|
|
Rake::Task['searchindex:drop'].invoke
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|