Skip to content
Snippets Groups Projects
Commit 6641341b authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Merge pull request #8254 from cirosantilli/factor-get-shell-version

Factor GITLAB_SHELL_VERSION get method
parents 36f9224e f36db59d
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -8,6 +8,13 @@ module Gitlab
end
end
 
class << self
def version_required
@version_required ||= File.read(Rails.root.
join('GITLAB_SHELL_VERSION')).strip
end
end
# Init new repository
#
# name - project path with namespace
Loading
Loading
Loading
Loading
@@ -574,20 +574,16 @@ namespace :gitlab do
Gitlab::Shell.new.version
end
 
def required_gitlab_shell_version
File.read(File.join(Rails.root, "GITLAB_SHELL_VERSION")).strip
end
def gitlab_shell_major_version
required_gitlab_shell_version.split(".")[0].to_i
Gitlab::Shell.version_required.split('.')[0].to_i
end
 
def gitlab_shell_minor_version
required_gitlab_shell_version.split(".")[1].to_i
Gitlab::Shell.version_required.split('.')[1].to_i
end
 
def gitlab_shell_patch_version
required_gitlab_shell_version.split(".")[2].to_i
Gitlab::Shell.version_required.split('.')[2].to_i
end
 
def has_gitlab_shell3?
Loading
Loading
Loading
Loading
@@ -4,7 +4,7 @@ namespace :gitlab do
task :install, [:tag, :repo] => :environment do |t, args|
warn_user_is_not_gitlab
 
default_version = File.read(File.join(Rails.root, "GITLAB_SHELL_VERSION")).strip
default_version = Gitlab::Shell.version_required
args.with_defaults(tag: 'v' + default_version, repo: "https://gitlab.com/gitlab-org/gitlab-shell.git")
 
user = Gitlab.config.gitlab.user
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment