Commit f7c360ca authored by Robert Speicher's avatar Robert Speicher

Merge branch 'update-gitlab-shell-in-tests' into 'master'

Update the gitlab-shell version in the tmp/tests directory to the right version

Previously the gitlab-shell version would never be updated if the directory existed via the `gitlab:shell:install` Rake task. This could lead to incompatibility issues or random errors.

See merge request !5646
parents f4282412 8a62f4e7
...@@ -5,7 +5,8 @@ namespace :gitlab do ...@@ -5,7 +5,8 @@ namespace :gitlab do
warn_user_is_not_gitlab warn_user_is_not_gitlab
default_version = Gitlab::Shell.version_required default_version = Gitlab::Shell.version_required
args.with_defaults(tag: 'v' + default_version, repo: "https://gitlab.com/gitlab-org/gitlab-shell.git") default_version_tag = 'v' + default_version
args.with_defaults(tag: default_version_tag, repo: "https://gitlab.com/gitlab-org/gitlab-shell.git")
user = Gitlab.config.gitlab.user user = Gitlab.config.gitlab.user
home_dir = Rails.env.test? ? Rails.root.join('tmp/tests') : Gitlab.config.gitlab.user_home home_dir = Rails.env.test? ? Rails.root.join('tmp/tests') : Gitlab.config.gitlab.user_home
...@@ -15,7 +16,12 @@ namespace :gitlab do ...@@ -15,7 +16,12 @@ namespace :gitlab do
target_dir = Gitlab.config.gitlab_shell.path target_dir = Gitlab.config.gitlab_shell.path
# Clone if needed # Clone if needed
unless File.directory?(target_dir) if File.directory?(target_dir)
Dir.chdir(target_dir) do
system(*%W(Gitlab.config.git.bin_path} fetch --tags --quiet))
system(*%W(Gitlab.config.git.bin_path} checkout --quiet #{default_version_tag}))
end
else
system(*%W(#{Gitlab.config.git.bin_path} clone -- #{args.repo} #{target_dir})) system(*%W(#{Gitlab.config.git.bin_path} clone -- #{args.repo} #{target_dir}))
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment