Skip to content

Commit

Permalink
install & update
Browse files Browse the repository at this point in the history
  • Loading branch information
gitlabhq committed Oct 14, 2011
2 parents a18924e + 0f6ebcb commit 2cd52b4
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 56 deletions.
9 changes: 9 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,20 @@ GIT

GIT
remote: git://github.com/mbleigh/seed-fu.git
<<<<<<< HEAD
revision: 77be06852b18fb01e272ab763ddb292da575586c
specs:
seed-fu (2.1.0)
activerecord (~> 3.1.0)
activesupport (~> 3.1.0)
=======
revision: 29fe8c61ca6cc4408115ea7475fe2647081bd348
branch: rails-3-1
specs:
seed-fu (2.0.1.rails31)
activerecord (~> 3.1.0.rc4)
activesupport (~> 3.1.0.rc4)
>>>>>>> d3784687943e0bd699d73d82a6bc6cac39689473

GEM
remote: http://rubygems.org/
Expand Down
3 changes: 3 additions & 0 deletions app/views/commits/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
= select_tag "tag", options_for_select(@project.tags, @branch), :onchange => "this.form.submit();", :class => "", :prompt => "Tags"
= text_field_tag "ssh", @project.url_to_repo, :class => ["ssh_project_url", "one_click_select"]
.clear
<<<<<<< HEAD
- if params[:path]
%h3{:style => "color:#555"} /#{params[:path]}
=======
>>>>>>> d3784687943e0bd699d73d82a6bc6cac39689473
%div{:id => dom_id(@project)}
= render "commits"
5 changes: 0 additions & 5 deletions configure.rb

This file was deleted.

32 changes: 32 additions & 0 deletions install.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
root_path = File.expand_path(File.dirname(__FILE__))
require File.join(root_path, "lib", "color")
include Color

#
# ruby ./update.rb development # or test or production (default)
#
envs = ["production", "test", "development"]
env = if envs.include?(ARGV[0])
ARGV[0]
else
"production"
end

puts green " == Install for ENV=#{env} ..."

# pull from github
`git pull origin 1x`

# bundle install
if env == "production"
`bundle install --without development test`
else
`bundle install`
end

# migrate db
`bundle exec rake db:setup RAILS_ENV=#{env}`
`bundle exec rake db:seed_fu RAILS_ENV=#{env}`


puts green " == Done! Now you can start server"
51 changes: 0 additions & 51 deletions install/prepare.rb

This file was deleted.

25 changes: 25 additions & 0 deletions lib/color.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module Color
def colorize(text, color_code)
"\033[#{color_code}#{text}\033[0m"
end

def red(text)
colorize(text, "31m")
end

def green(text)
colorize(text, "32m")
end

def command(string)
`#{string}`
if $?.to_i > 0
puts red " == #{string} - FAIL"
puts red " == Error during configure"
exit
else
puts green " == #{string} - OK"
end
end
end

31 changes: 31 additions & 0 deletions update.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
root_path = File.expand_path(File.dirname(__FILE__))
require File.join(root_path, "lib", "color")
include Color

#
# ruby ./update.rb development # or test or production (default)
#
envs = ["production", "test", "development"]
env = if envs.include?(ARGV[0])
ARGV[0]
else
"production"
end

puts green " == Update for ENV=#{env} from 1x"

# pull from github
`git pull origin 1x`

# bundle install
if env == "production"
`bundle install --without development test`
else
`bundle install`
end

# migrate db
`bundle exec rake db:migrate RAILS_ENV=#{env}`


puts green " == Done! Now you can start/restart server"

0 comments on commit 2cd52b4

Please sign in to comment.