diff options
author | Robert Speicher <robert@gitlab.com> | 2016-08-03 19:17:36 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2016-08-03 19:17:36 +0000 |
commit | f7c360cad6973331b046140acf799427463c0857 (patch) | |
tree | 3536b5b8b6ff2eb6b7d33a48adca6a3afc9ba26f | |
parent | f4282412be181701ee43369dd092a69c3b3b9e65 (diff) | |
parent | 8a62f4e7d46908c56bedf155792323dc4218be94 (diff) | |
download | gitlab-ce-f7c360cad6973331b046140acf799427463c0857.tar.gz |
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
-rw-r--r-- | lib/tasks/gitlab/shell.rake | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/tasks/gitlab/shell.rake b/lib/tasks/gitlab/shell.rake index c85ebdf8619..ba93945bd03 100644 --- a/lib/tasks/gitlab/shell.rake +++ b/lib/tasks/gitlab/shell.rake @@ -5,7 +5,8 @@ namespace :gitlab do warn_user_is_not_gitlab 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 home_dir = Rails.env.test? ? Rails.root.join('tmp/tests') : Gitlab.config.gitlab.user_home @@ -15,7 +16,12 @@ namespace :gitlab do target_dir = Gitlab.config.gitlab_shell.path # 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})) end |