Commit 35d24b3928a0905d23e8e33bbc9a89d33fa0a480
1 parent
1c266072
Exists in
master
and in
4 other branches
cleaning
Showing
5 changed files
with
23 additions
and
80 deletions
Show diff stats
README.rdoc
| ... | ... | @@ -36,18 +36,19 @@ sqlite as default db |
| 36 | 36 | echo "gitlabhq ALL = (git) NOPASSWD: /bin/rm" | sudo tee -a /etc/sudoers |
| 37 | 37 | |
| 38 | 38 | sudo gem install bundler |
| 39 | + | |
| 39 | 40 | bundle |
| 40 | 41 | |
| 41 | - RAILS_ENV=production rake db:setup | |
| 42 | + bundle exec rake db:setup RAILS_ENV=production | |
| 42 | 43 | |
| 43 | 44 | # create admin user |
| 44 | 45 | # login....admin@local.host |
| 45 | 46 | # pass.....5iveL!fe |
| 46 | - RAILS_ENV=production rake db:seed_fu | |
| 47 | + bundle exec rake db:seed_fu RAILS_ENV=production | |
| 47 | 48 | |
| 48 | 49 | Install gitosis, edit conf/gitosis.yml & start server |
| 49 | 50 | |
| 50 | - rails s | |
| 51 | + rails s -e production | |
| 51 | 52 | |
| 52 | 53 | == Install Gitosis |
| 53 | 54 | sudo aptitude install gitosis |
| ... | ... | @@ -65,6 +66,7 @@ Install gitosis, edit conf/gitosis.yml & start server |
| 65 | 66 | ssh-keygen -t rsa |
| 66 | 67 | |
| 67 | 68 | sudo -H -u git gitosis-init < ~/.ssh/id_rsa.pub |
| 69 | + | |
| 68 | 70 | sudo chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update |
| 69 | 71 | |
| 70 | 72 | ... | ... |
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 | - |