Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'gems/gitlab-backup-cli/lib/gitlab/backup/cli/runner.rb')
-rw-r--r--gems/gitlab-backup-cli/lib/gitlab/backup/cli/runner.rb34
1 files changed, 34 insertions, 0 deletions
diff --git a/gems/gitlab-backup-cli/lib/gitlab/backup/cli/runner.rb b/gems/gitlab-backup-cli/lib/gitlab/backup/cli/runner.rb
new file mode 100644
index 00000000000..b04386f75c0
--- /dev/null
+++ b/gems/gitlab-backup-cli/lib/gitlab/backup/cli/runner.rb
@@ -0,0 +1,34 @@
+# frozen_string_literal: true
+
+require 'thor'
+
+module Gitlab
+ module Backup
+ module Cli
+ # GitLab Backup CLI
+ #
+ # This supersedes the previous backup rake files and will be
+ # the default interface to handle backups
+ class Runner < Thor
+ def self.exit_on_failure?
+ true
+ end
+
+ map %w[--version -v] => :version
+ desc 'version', 'Display the version information'
+
+ def version
+ puts "GitLab Backup CLI (#{VERSION})" # rubocop:disable Rails/Output -- CLI output
+ end
+
+ private
+
+ def rails_environment!
+ require APP_PATH
+
+ Rails.application.load_tasks
+ end
+ end
+ end
+ end
+end