Commit 6d0175e1f641415574a8fc48909af2cb3a357882
1 parent
86021a7d
Exists in
master
and in
4 other branches
cleaning
Showing
5 changed files
with
23 additions
and
80 deletions
Show diff stats
README.rdoc
| ... | ... | @@ -34,18 +34,19 @@ sqlite as default db |
| 34 | 34 | sudo easy_install pygments |
| 35 | 35 | |
| 36 | 36 | sudo gem install bundler |
| 37 | + | |
| 37 | 38 | bundle |
| 38 | 39 | |
| 39 | - RAILS_ENV=production rake db:setup | |
| 40 | + bundle exec rake db:setup RAILS_ENV=production | |
| 40 | 41 | |
| 41 | 42 | # create admin user |
| 42 | 43 | # login....admin@local.host |
| 43 | 44 | # pass.....5iveL!fe |
| 44 | - RAILS_ENV=production rake db:seed_fu | |
| 45 | + bundle exec rake db:seed_fu RAILS_ENV=production | |
| 45 | 46 | |
| 46 | 47 | Install gitosis, edit conf/gitosis.yml & start server |
| 47 | 48 | |
| 48 | - rails s | |
| 49 | + rails s -e production | |
| 49 | 50 | |
| 50 | 51 | == Install Gitosis |
| 51 | 52 | sudo aptitude install gitosis |
| ... | ... | @@ -63,6 +64,7 @@ Install gitosis, edit conf/gitosis.yml & start server |
| 63 | 64 | ssh-keygen -t rsa |
| 64 | 65 | |
| 65 | 66 | sudo -H -u git gitosis-init < ~/.ssh/id_rsa.pub |
| 67 | + | |
| 66 | 68 | sudo chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update |
| 67 | 69 | |
| 68 | 70 | ... | ... |
db/fixtures/development/001_admin.rb
| 1 | -# Admin account | |
| 2 | 1 | admin = User.create( |
| 3 | 2 | :email => "admin@local.host", |
| 4 | 3 | :name => "Administrator", |
| ... | ... | @@ -9,3 +8,12 @@ admin = User.create( |
| 9 | 8 | admin.projects_limit = 10000 |
| 10 | 9 | admin.admin = true |
| 11 | 10 | admin.save! |
| 11 | + | |
| 12 | +if admin.valid? | |
| 13 | +puts %q[ | |
| 14 | +Administrator account created: | |
| 15 | + | |
| 16 | +login.........admin@local.host | |
| 17 | +password......5iveL!fe | |
| 18 | +] | |
| 19 | +end | ... | ... |
db/fixtures/production/001_admin.rb
install.rb
| ... | ... | @@ -1,32 +0,0 @@ |
| 1 | -root_path = File.expand_path(File.dirname(__FILE__)) | |
| 2 | -require File.join(root_path, "lib", "color") | |
| 3 | -include Color | |
| 4 | - | |
| 5 | -# | |
| 6 | -# ruby ./update.rb development # or test or production (default) | |
| 7 | -# | |
| 8 | -envs = ["production", "test", "development"] | |
| 9 | -env = if envs.include?(ARGV[0]) | |
| 10 | - ARGV[0] | |
| 11 | - else | |
| 12 | - "production" | |
| 13 | - end | |
| 14 | - | |
| 15 | -puts green " == Install for ENV=#{env} ..." | |
| 16 | - | |
| 17 | -# bundle install | |
| 18 | -`bundle install` | |
| 19 | - | |
| 20 | -# migrate db | |
| 21 | -`bundle exec rake db:create RAILS_ENV=#{env}` | |
| 22 | -`bundle exec rake db:schema:load RAILS_ENV=#{env}` | |
| 23 | -`bundle exec rake db:seed_fu RAILS_ENV=#{env}` | |
| 24 | - | |
| 25 | -puts green %q[ | |
| 26 | -Administrator account created: | |
| 27 | - | |
| 28 | -login.........admin@local.host | |
| 29 | -password......5iveL!fe | |
| 30 | -] | |
| 31 | - | |
| 32 | -puts green " == Done! Now you can start server" |
update.rb
| ... | ... | @@ -1,44 +0,0 @@ |
| 1 | -root_path = File.expand_path(File.dirname(__FILE__)) | |
| 2 | -require File.join(root_path, "lib", "color") | |
| 3 | -include Color | |
| 4 | - | |
| 5 | -def version | |
| 6 | - File.read("VERSION") | |
| 7 | -end | |
| 8 | - | |
| 9 | -# | |
| 10 | -# ruby ./update.rb development # or test or production (default) | |
| 11 | -# | |
| 12 | -envs = ["production", "test", "development"] | |
| 13 | -env = if envs.include?(ARGV[0]) | |
| 14 | - ARGV[0] | |
| 15 | - else | |
| 16 | - "production" | |
| 17 | - end | |
| 18 | - | |
| 19 | -puts yellow "== RAILS ENV | #{env}" | |
| 20 | -current_version = version | |
| 21 | -puts yellow "Your version is #{current_version}" | |
| 22 | -puts yellow "Check for new version: $ git pull origin 1x" | |
| 23 | -`git pull origin 1x` # pull from origin | |
| 24 | - | |
| 25 | -# latest version | |
| 26 | -if version == current_version | |
| 27 | - puts yellow "You have a latest version" | |
| 28 | -else | |
| 29 | - puts green "Update to #{version}" | |
| 30 | - | |
| 31 | -`bundle install` | |
| 32 | - | |
| 33 | - # migrate db | |
| 34 | -if env == "development" | |
| 35 | -`bundle exec rake db:migrate RAILS_ENV=development` | |
| 36 | -`bundle exec rake db:migrate RAILS_ENV=test` | |
| 37 | -else | |
| 38 | -`bundle exec rake db:migrate RAILS_ENV=#{env}` | |
| 39 | -end | |
| 40 | - | |
| 41 | - puts green "== Done! Now you can start/restart server" | |
| 42 | -end | |
| 43 | - | |
| 44 | - |