summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2011-12-15 23:04:59 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2011-12-15 23:04:59 +0200
commitd9cfb7985e1f68cfbb5e836034b200b1a2d8e4c1 (patch)
tree8d162c340d36090c865bbd3d782bb70242e32257
parentf94d51d765b185c53a98f6541cb5b834117f4024 (diff)
downloadgitlab-ce-d9cfb7985e1f68cfbb5e836034b200b1a2d8e4c1.tar.gz
dev seeds & dev scripts
-rw-r--r--db/fixtures/development/002_project.rb2
-rw-r--r--db/fixtures/development/004_teams.rb6
-rw-r--r--db/fixtures/development/006_wall.rb40
-rw-r--r--lib/tasks/dev_repo.rake24
-rwxr-xr-xlib/tasks/dev_user.sh7
5 files changed, 75 insertions, 4 deletions
diff --git a/db/fixtures/development/002_project.rb b/db/fixtures/development/002_project.rb
index 8eb99f2ce02..eea987ffcc2 100644
--- a/db/fixtures/development/002_project.rb
+++ b/db/fixtures/development/002_project.rb
@@ -1,5 +1,5 @@
Project.seed(:id, [
- { :id => 1, :name => "Gitlab HQ", :path => "gitlabhq", :code => "gitlabhq", :owner_id => 1 },
+ { :id => 1, :name => "Rubinius", :path => "rubinius", :code => "rubinius", :owner_id => 1 },
{ :id => 2, :name => "Diaspora", :path => "diaspora", :code => "diaspora", :owner_id => 1 },
{ :id => 3, :name => "Ruby on Rails", :path => "ruby_on_rails", :code => "ruby_on_rails", :owner_id => 1 }
])
diff --git a/db/fixtures/development/004_teams.rb b/db/fixtures/development/004_teams.rb
index bfa6d9ae1d1..a973cac8790 100644
--- a/db/fixtures/development/004_teams.rb
+++ b/db/fixtures/development/004_teams.rb
@@ -1,17 +1,17 @@
UsersProject.seed(:id, [
- { :id => 1, :project_id => 1, :user_id => 1, :project_access => Project::PROJECT_RWA, :repo_access => Repository::REPO_N },
+ { :id => 1, :project_id => 1, :user_id => 1, :project_access => Project::PROJECT_RWA, :repo_access => Repository::REPO_RW },
{ :id => 2, :project_id => 1, :user_id => 2, :project_access => Project::PROJECT_RW, :repo_access => Repository::REPO_N },
{ :id => 3, :project_id => 1, :user_id => 3, :project_access => Project::PROJECT_RW, :repo_access => Repository::REPO_N },
{ :id => 4, :project_id => 1, :user_id => 4, :project_access => Project::PROJECT_R, :repo_access => Repository::REPO_N },
{ :id => 5, :project_id => 1, :user_id => 5, :project_access => Project::PROJECT_R, :repo_access => Repository::REPO_N },
- { :id => 6, :project_id => 2, :user_id => 1, :project_access => Project::PROJECT_RWA, :repo_access => Repository::REPO_N },
+ { :id => 6, :project_id => 2, :user_id => 1, :project_access => Project::PROJECT_RWA, :repo_access => Repository::REPO_RW },
{ :id => 7, :project_id => 2, :user_id => 2, :project_access => Project::PROJECT_R, :repo_access => Repository::REPO_N },
{ :id => 8, :project_id => 2, :user_id => 3, :project_access => Project::PROJECT_R, :repo_access => Repository::REPO_N },
{ :id => 9, :project_id => 2, :user_id => 4, :project_access => Project::PROJECT_RWA, :repo_access => Repository::REPO_N },
{ :id => 11, :project_id => 2, :user_id => 5, :project_access => Project::PROJECT_RWA, :repo_access => Repository::REPO_N },
- { :id => 12, :project_id => 3, :user_id => 1, :project_access => Project::PROJECT_RWA, :repo_access => Repository::REPO_N },
+ { :id => 12, :project_id => 3, :user_id => 1, :project_access => Project::PROJECT_RWA, :repo_access => Repository::REPO_RW },
{ :id => 13, :project_id => 3, :user_id => 2, :project_access => Project::PROJECT_R, :repo_access => Repository::REPO_N },
{ :id => 14, :project_id => 3, :user_id => 3, :project_access => Project::PROJECT_RWA, :repo_access => Repository::REPO_N },
{ :id => 15, :project_id => 3, :user_id => 4, :project_access => Project::PROJECT_R, :repo_access => Repository::REPO_N },
diff --git a/db/fixtures/development/006_wall.rb b/db/fixtures/development/006_wall.rb
new file mode 100644
index 00000000000..7c0d25d1000
--- /dev/null
+++ b/db/fixtures/development/006_wall.rb
@@ -0,0 +1,40 @@
+Note.seed(:id, [
+ { :id => 1, :project_id => 1, :author_id => 1, :note => Faker::Lorem.sentence(6) },
+ { :id => 2, :project_id => 1, :author_id => 2, :note => Faker::Lorem.sentence(6) },
+ { :id => 3, :project_id => 1, :author_id => 3, :note => Faker::Lorem.sentence(6) },
+ { :id => 4, :project_id => 1, :author_id => 4, :note => Faker::Lorem.sentence(6) },
+ { :id => 5, :project_id => 1, :author_id => 5, :note => Faker::Lorem.sentence(6) },
+
+ { :id => 6, :project_id => 2, :author_id => 1, :note => Faker::Lorem.sentence(6) },
+ { :id => 7, :project_id => 2, :author_id => 2, :note => Faker::Lorem.sentence(6) },
+ { :id => 8, :project_id => 2, :author_id => 3, :note => Faker::Lorem.sentence(6) },
+ { :id => 9, :project_id => 2, :author_id => 4, :note => Faker::Lorem.sentence(6) },
+ { :id => 11, :project_id => 2, :author_id => 5, :note => Faker::Lorem.sentence(6) },
+
+ { :id => 12, :project_id => 3, :author_id => 1, :note => Faker::Lorem.sentence(6)},
+ { :id => 13, :project_id => 3, :author_id => 2, :note => Faker::Lorem.sentence(6)},
+ { :id => 14, :project_id => 3, :author_id => 3, :note => Faker::Lorem.sentence(6)},
+ { :id => 15, :project_id => 3, :author_id => 4, :note => Faker::Lorem.sentence(6)},
+ { :id => 16, :project_id => 3, :author_id => 5, :note => Faker::Lorem.sentence(6)},
+
+ { :id => 21, :project_id => 1, :author_id => 1, :note => Faker::Lorem.sentence(6) },
+ { :id => 22, :project_id => 1, :author_id => 2, :note => Faker::Lorem.sentence(6) },
+ { :id => 23, :project_id => 1, :author_id => 3, :note => Faker::Lorem.sentence(6) },
+ { :id => 24, :project_id => 1, :author_id => 4, :note => Faker::Lorem.sentence(6) },
+ { :id => 25, :project_id => 1, :author_id => 5, :note => Faker::Lorem.sentence(6) },
+
+ { :id => 26, :project_id => 2, :author_id => 1, :note => Faker::Lorem.sentence(6) },
+ { :id => 27, :project_id => 2, :author_id => 2, :note => Faker::Lorem.sentence(6) },
+ { :id => 28, :project_id => 2, :author_id => 3, :note => Faker::Lorem.sentence(6) },
+ { :id => 29, :project_id => 2, :author_id => 4, :note => Faker::Lorem.sentence(6) },
+ { :id => 30, :project_id => 2, :author_id => 5, :note => Faker::Lorem.sentence(6) },
+
+ { :id => 32, :project_id => 3, :author_id => 1, :note => Faker::Lorem.sentence(6)},
+ { :id => 33, :project_id => 3, :author_id => 2, :note => Faker::Lorem.sentence(6)},
+ { :id => 34, :project_id => 3, :author_id => 3, :note => Faker::Lorem.sentence(6)},
+ { :id => 35, :project_id => 3, :author_id => 4, :note => Faker::Lorem.sentence(6)},
+ { :id => 36, :project_id => 3, :author_id => 5, :note => Faker::Lorem.sentence(6)}
+])
+
+
+
diff --git a/lib/tasks/dev_repo.rake b/lib/tasks/dev_repo.rake
new file mode 100644
index 00000000000..4e5feaa4349
--- /dev/null
+++ b/lib/tasks/dev_repo.rake
@@ -0,0 +1,24 @@
+desc "Prepare for development"
+task :dev_repo => :environment do
+key = `sudo -u gitlabdev -H cat /home/gitlabdev/.ssh/id_rsa.pub`
+raise "\n *** Run ./lib/tasks/dev_user.sh first *** \n" if key.empty?
+Key.create(:user_id => User.first, :key => key, :title => "gitlabdev")
+
+puts "\n *** Clone diaspora from github"
+`sudo -u gitlabdev -H git clone git://github.com/diaspora/diaspora.git /home/gitlabdev/diaspora`
+
+puts "\n *** Push diaspora source to gitlab"
+`sudo -u gitlabdev -H sh -c "cd /home/gitlabdev/diaspora; git remote add local git@localhost:diaspora.git; git push local master; git push local --tags; git checkout -b api origin/api; git push local api; git checkout -b heroku origin/heroku; git push local heroku"`
+
+puts "\n *** Clone rails from github"
+`sudo -u gitlabdev -H git clone git://github.com/rails/rails.git /home/gitlabdev/rails`
+
+puts "\n *** Push rails source to gitlab"
+`sudo -u gitlabdev -H sh -c "cd /home/gitlabdev/rails; git remote add local git@localhost:ruby_on_rails.git; git push local master; git push local --tags"`
+
+puts "\n *** Clone rubinius from github"
+`sudo -u gitlabdev -H git clone git://github.com/rubinius/rubinius.git /home/gitlabdev/rubinius`
+
+puts "\n *** Push rubinius source to gitlab"
+`sudo -u gitlabdev -H sh -c "cd /home/gitlabdev/rubinius; git remote add local git@localhost:rubinius.git; git push local master; git push local --tags"`
+end
diff --git a/lib/tasks/dev_user.sh b/lib/tasks/dev_user.sh
new file mode 100755
index 00000000000..d6b20df2ef2
--- /dev/null
+++ b/lib/tasks/dev_user.sh
@@ -0,0 +1,7 @@
+sudo adduser \
+ --gecos 'gitlab dev user' \
+ --disabled-password \
+ --home /home/gitlabdev \
+ gitlabdev
+
+sudo -i -u gitlabdev -H sh -c "ssh-keygen -t rsa"