Commit bd43cf06 authored by Marin Jankovski's avatar Marin Jankovski

Use system where only return result is needed.

parent cd4c65c1
...@@ -17,17 +17,17 @@ namespace :gitlab do ...@@ -17,17 +17,17 @@ namespace :gitlab do
# Clone if needed # Clone if needed
unless File.directory?(target_dir) unless File.directory?(target_dir)
Gitlab::Popen.popen(%W(git clone -- #{args.repo} #{target_dir})) system(%W(git clone -- #{args.repo} #{target_dir}))
end end
# Make sure we're on the right tag # Make sure we're on the right tag
Dir.chdir(target_dir) do Dir.chdir(target_dir) do
# First try to checkout without fetching # First try to checkout without fetching
# to avoid stalling tests if the Internet is down. # to avoid stalling tests if the Internet is down.
reset_status = reset_to_commit(args) reseted = reset_to_commit(args)
if reset_status != 0 unless reseted
Gitlab::Popen.popen(%W(git fetch origin)) system(%W(git fetch origin))
reset_to_commit(args) reset_to_commit(args)
end end
...@@ -58,7 +58,7 @@ namespace :gitlab do ...@@ -58,7 +58,7 @@ namespace :gitlab do
File.open("config.yml", "w+") {|f| f.puts config.to_yaml} File.open("config.yml", "w+") {|f| f.puts config.to_yaml}
# Launch installation process # Launch installation process
Gitlab::Popen.popen(%W(bin/install)) system(%W(bin/install))
end end
# Required for debian packaging with PKGR: Setup .ssh/environment with # Required for debian packaging with PKGR: Setup .ssh/environment with
...@@ -126,13 +126,12 @@ namespace :gitlab do ...@@ -126,13 +126,12 @@ namespace :gitlab do
def reset_to_commit(args) def reset_to_commit(args)
tag, status = Gitlab::Popen.popen(%W(git describe -- #{args.tag})) tag, status = Gitlab::Popen.popen(%W(git describe -- #{args.tag}))
if status != 0 unless status.zero?
tag, status = Gitlab::Popen.popen(%W(git describe -- origin/#{args.tag})) tag, status = Gitlab::Popen.popen(%W(git describe -- origin/#{args.tag}))
end end
tag = tag.strip tag = tag.strip
reset, reset_status = Gitlab::Popen.popen(%W(git reset --hard #{tag})) system(%W(git reset --hard #{tag}))
reset_status
end end
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