summaryrefslogtreecommitdiff
path: root/lib/tasks
diff options
context:
space:
mode:
authorCiro Santilli <ciro.santilli@gmail.com>2014-10-22 10:54:59 +0200
committerCiro Santilli <ciro.santilli@gmail.com>2014-11-18 11:38:23 +0100
commit533f4cdf30b38c587f7a91f0dfd898b907ecd944 (patch)
treed7ff63cc56fa128bb6310496af9c44daa4d3d0b9 /lib/tasks
parentd803f210aa5e87a441fca562910122f2cfde9fa6 (diff)
downloadgitlab-ce-533f4cdf30b38c587f7a91f0dfd898b907ecd944.tar.gz
gitlab shell works if multiple rubies installed
Before this it would fail because git hooks automatically prepend things to the path, which can lead the wrong Ruby version to be called in which dependencies are not installed. To make sure that this is correct, the forked_merge_requests commented out test that depends on this change was uncommented. For that test to pass, it is also necessary to setup the mock server on port 3001 under test_env.rb.
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/gitlab/shell.rake12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/tasks/gitlab/shell.rake b/lib/tasks/gitlab/shell.rake
index 202e55c89ad..d3cc7135c54 100644
--- a/lib/tasks/gitlab/shell.rake
+++ b/lib/tasks/gitlab/shell.rake
@@ -22,10 +22,14 @@ namespace :gitlab do
# Make sure we're on the right tag
Dir.chdir(target_dir) do
+ # Allows to change the origin URL to the fork
+ # when developing gitlab-shell.
+ sh(*%W(git remote set-url origin #{args.repo}))
+
# First try to checkout without fetching
# to avoid stalling tests if the Internet is down.
- reset = "git reset --hard $(git describe #{args.tag} || git describe origin/#{args.tag})"
- sh "#{reset} || git fetch origin && #{reset}"
+ reset = "(rev=\"$(git describe #{args.tag} || git describe \"origin/#{args.tag}\")\" && git reset --hard \"$rev\")"
+ sh "#{reset} || (git fetch --tags origin && #{reset})"
config = {
user: user,
@@ -37,7 +41,7 @@ namespace :gitlab do
bin: %x{which redis-cli}.chomp,
namespace: "resque:gitlab"
}.stringify_keys,
- log_level: "INFO",
+ log_level: Rails.env.test? ? 'DEBUG' : 'INFO',
audit_usernames: false
}.stringify_keys
@@ -66,6 +70,8 @@ namespace :gitlab do
File.open(File.join(home_dir, ".ssh", "environment"), "w+") do |f|
f.puts "PATH=#{ENV['PATH']}"
end
+
+ Gitlab::Shell.setup_secret_token
end
desc "GITLAB | Setup gitlab-shell"