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
path: root/db
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2012-08-29 05:13:22 +0400
committerRobert Speicher <rspeicher@gmail.com>2012-08-29 05:22:49 +0400
commita3a63eeb92f5cc660dc3f03e2d7249e4b5f04acf (patch)
treef8a74fe256a7d0da86b39735e05555f844bba396 /db
parenta39cfb54616fe156ba43ac3df2b771c3a11d2879 (diff)
Remove all instances to 'gitlabhq_x' seed repositories from specs and features
We now need only one seed repo! Also cleans up the seeding script.
Diffstat (limited to 'db')
-rw-r--r--db/fixtures/test/001_repo.rb36
1 files changed, 22 insertions, 14 deletions
diff --git a/db/fixtures/test/001_repo.rb b/db/fixtures/test/001_repo.rb
index ebf005a1467..67d4e7bfbde 100644
--- a/db/fixtures/test/001_repo.rb
+++ b/db/fixtures/test/001_repo.rb
@@ -1,15 +1,23 @@
-# create tmp dir if not exist
-tmp_dir = File.join(Rails.root, "tmp")
-Dir.mkdir(tmp_dir) unless File.exists?(tmp_dir)
-
-# Create dir for test repo
-repo_dir = File.join(Rails.root, "tmp", "tests")
-Dir.mkdir(repo_dir) unless File.exists?(repo_dir)
-
-`cp spec/seed_project.tar.gz tmp/tests/`
-Dir.chdir(repo_dir)
-`tar -xf seed_project.tar.gz`
-3.times do |i|
-`cp -r gitlabhq/ gitlabhq_#{i}/`
-puts "Unpacked seed repo - tmp/tests/gitlabhq_#{i}"
+require 'fileutils'
+
+print "Unpacking seed repository..."
+
+SEED_REPO = 'seed_project.tar.gz'
+REPO_PATH = File.join(Rails.root, 'tmp', 'repositories')
+
+# Make whatever directories we need to make
+FileUtils.mkdir_p(REPO_PATH)
+
+# Copy the archive to the repo path
+FileUtils.cp(File.join(Rails.root, 'spec', SEED_REPO), REPO_PATH)
+
+# chdir to the repo path
+FileUtils.cd(REPO_PATH) do
+ # Extract the archive
+ `tar -xf #{SEED_REPO}`
+
+ # Remove the copy
+ FileUtils.rm(SEED_REPO)
end
+
+puts ' done.'