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:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-29 00:06:24 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-29 00:06:24 +0300
commitef326e805ac99222c55e1efd9867045800f01a4b (patch)
tree201d39fb90a1422cc1f523d95b30b93e95f973f5 /lib/gitlab/task_helpers.rb
parent7515ec41c527c62bfd56f46e388cf6d9fe06479f (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/task_helpers.rb')
-rw-r--r--lib/gitlab/task_helpers.rb18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/gitlab/task_helpers.rb b/lib/gitlab/task_helpers.rb
index 8532845f3cb..ac02ec635e4 100644
--- a/lib/gitlab/task_helpers.rb
+++ b/lib/gitlab/task_helpers.rb
@@ -158,15 +158,17 @@ module Gitlab
end
def checkout_or_clone_version(version:, repo:, target_dir:)
- version =
- if version.starts_with?("=")
- version.sub(/\A=/, '') # tag or branch
- else
- "v#{version}" # tag
- end
-
clone_repo(repo, target_dir) unless Dir.exist?(target_dir)
- checkout_version(version, target_dir)
+ checkout_version(get_version(version), target_dir)
+ end
+
+ # this function implements the same logic we have in omnibus for dealing with components version
+ def get_version(component_version)
+ # If not a valid version string following SemVer it is probably a branch name or a SHA
+ # commit of one of our own component so it doesn't need `v` prepended
+ return component_version unless /^\d+\.\d+\.\d+(-rc\d+)?$/.match?(component_version)
+
+ "v#{component_version}"
end
def clone_repo(repo, target_dir)