forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
tootctl search deploy
to avoid ugly rake task syntax (mastodon#…
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative '../../config/boot' | ||
require_relative '../../config/environment' | ||
require_relative 'cli_helper' | ||
|
||
module Mastodon | ||
class SearchCLI < Thor | ||
desc 'deploy', 'Create or update an ElasticSearch index and populate it' | ||
long_desc <<~LONG_DESC | ||
If ElasticSearch is empty, this command will create the necessary indices | ||
and then import data from the database into those indices. | ||
This command will also upgrade indices if the underlying schema has been | ||
changed since the last run. | ||
LONG_DESC | ||
def deploy | ||
processed = Chewy::RakeHelper.upgrade | ||
Chewy::RakeHelper.sync(except: processed) | ||
end | ||
end | ||
end |