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
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-09 17:13:56 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-09 17:13:56 +0400
commit38985390b061a0d1d0d91d5574f612b4710768b6 (patch)
tree5a12b84b5413450d169651afe351f9da01be1f3d /db/fixtures/development
parent152f87864c020bfcd49b134e9c97b81e9ef1c215 (diff)
Refactored and fixed seeds to work with gitlab-shell
Diffstat (limited to 'db/fixtures/development')
-rw-r--r--db/fixtures/development/01_admin.rb (renamed from db/fixtures/development/001_admin.rb)0
-rw-r--r--db/fixtures/development/02_source_code.rb (renamed from db/fixtures/development/009_source_code.rb)20
-rw-r--r--db/fixtures/development/03_group.rb5
-rw-r--r--db/fixtures/development/04_project.rb (renamed from db/fixtures/development/002_project.rb)6
-rw-r--r--db/fixtures/development/05_users.rb (renamed from db/fixtures/development/003_users.rb)0
-rw-r--r--db/fixtures/development/06_teams.rb (renamed from db/fixtures/development/004_teams.rb)7
-rw-r--r--db/fixtures/development/07_milestones.rb (renamed from db/fixtures/development/005_milestones.rb)0
-rw-r--r--db/fixtures/development/08_wall.rb (renamed from db/fixtures/development/006_wall.rb)0
-rw-r--r--db/fixtures/development/09_issues.rb (renamed from db/fixtures/development/007_issues.rb)0
-rw-r--r--db/fixtures/development/10_merge_requests.rb (renamed from db/fixtures/development/008_merge_requests.rb)0
-rw-r--r--db/fixtures/development/11_keys.rb (renamed from db/fixtures/development/010_keys.rb)0
11 files changed, 14 insertions, 24 deletions
diff --git a/db/fixtures/development/001_admin.rb b/db/fixtures/development/01_admin.rb
index fbe41e4d22d..fbe41e4d22d 100644
--- a/db/fixtures/development/001_admin.rb
+++ b/db/fixtures/development/01_admin.rb
diff --git a/db/fixtures/development/009_source_code.rb b/db/fixtures/development/02_source_code.rb
index a64b905ee89..4a9e5d0c258 100644
--- a/db/fixtures/development/009_source_code.rb
+++ b/db/fixtures/development/02_source_code.rb
@@ -13,19 +13,17 @@ projects = [
projects.each do |project|
project_path = File.join(root, project[:path])
- next if File.exists?(project_path)
-
- cmds = [
- "cd #{root} && sudo -u git -H git clone --bare #{project[:git]} ./#{project[:path]}",
- "sudo ln -s ./lib/hooks/post-receive #{project_path}/hooks/post-receive",
- "sudo chown git:git -R #{project_path}",
- "sudo chmod 770 -R #{project_path}",
- ]
+ if File.exists?(project_path)
+ print '-'
+ next
+ end
- cmds.each do |cmd|
- puts cmd.yellow
- `#{cmd}`
+ if system("/home/git/gitlab-shell/bin/gitlab-projects import-project #{project[:path]} #{project[:git]}")
+ print '.'
+ else
+ print 'F'
end
end
puts "OK".green
+
diff --git a/db/fixtures/development/03_group.rb b/db/fixtures/development/03_group.rb
new file mode 100644
index 00000000000..01174a4b72a
--- /dev/null
+++ b/db/fixtures/development/03_group.rb
@@ -0,0 +1,5 @@
+Group.seed(:id, [
+ { id: 99, name: "GitLab", path: 'gitlab', owner_id: 1 },
+ { id: 100, name: "Brightbox", path: 'brightbox', owner_id: 1 },
+ { id: 101, name: "KDE", path: 'kde', owner_id: 1 },
+])
diff --git a/db/fixtures/development/002_project.rb b/db/fixtures/development/04_project.rb
index e50ab5d9d52..9904c48e518 100644
--- a/db/fixtures/development/002_project.rb
+++ b/db/fixtures/development/04_project.rb
@@ -1,9 +1,3 @@
-Group.seed(:id, [
- { id: 99, name: "GitLab", path: 'gitlab', owner_id: 1 },
- { id: 100, name: "Brightbox", path: 'brightbox', owner_id: 1 },
- { id: 101, name: "KDE", path: 'kde', owner_id: 1 },
-])
-
Project.seed(:id, [
# Global
diff --git a/db/fixtures/development/003_users.rb b/db/fixtures/development/05_users.rb
index abcb0259618..abcb0259618 100644
--- a/db/fixtures/development/003_users.rb
+++ b/db/fixtures/development/05_users.rb
diff --git a/db/fixtures/development/004_teams.rb b/db/fixtures/development/06_teams.rb
index 7a8f9139d3f..9fbf21a02d7 100644
--- a/db/fixtures/development/004_teams.rb
+++ b/db/fixtures/development/06_teams.rb
@@ -1,5 +1,3 @@
-UsersProject.skip_callback(:save, :after, :update_repository)
-
Gitlab::Seeder.quiet do
(1..300).each do |i|
@@ -21,9 +19,4 @@ Gitlab::Seeder.quiet do
print('.')
end
end
-
-UsersProject.set_callback(:save, :after, :update_repository)
-
-puts "\nRebuild gitolite\n".yellow
-Project.all.each(&:update_repository)
puts "OK".green
diff --git a/db/fixtures/development/005_milestones.rb b/db/fixtures/development/07_milestones.rb
index a77f619f995..a77f619f995 100644
--- a/db/fixtures/development/005_milestones.rb
+++ b/db/fixtures/development/07_milestones.rb
diff --git a/db/fixtures/development/006_wall.rb b/db/fixtures/development/08_wall.rb
index c4e304cc217..c4e304cc217 100644
--- a/db/fixtures/development/006_wall.rb
+++ b/db/fixtures/development/08_wall.rb
diff --git a/db/fixtures/development/007_issues.rb b/db/fixtures/development/09_issues.rb
index 8978db4742b..8978db4742b 100644
--- a/db/fixtures/development/007_issues.rb
+++ b/db/fixtures/development/09_issues.rb
diff --git a/db/fixtures/development/008_merge_requests.rb b/db/fixtures/development/10_merge_requests.rb
index 9904b4a1505..9904b4a1505 100644
--- a/db/fixtures/development/008_merge_requests.rb
+++ b/db/fixtures/development/10_merge_requests.rb
diff --git a/db/fixtures/development/010_keys.rb b/db/fixtures/development/11_keys.rb
index 8e4724c277c..8e4724c277c 100644
--- a/db/fixtures/development/010_keys.rb
+++ b/db/fixtures/development/11_keys.rb