inploy 1.6.0 → 1.6.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,14 +1,14 @@
1
1
  h2. ABOUT:
2
2
 
3
- Inploy was a born as an option to setup and deploy Rails applications in an easier and smarter way.
3
+ Inploy was born as an option to setup and deploy Rails applications in an easier and smarter way.
4
4
 
5
- It executes common tasks like migrate the database, install gems, package the assets, clean the cache, notified Hoptoad, restart the server, etc. automatically. This means you will not have a big deploy script calld 'recipe' like with other tools, only a simple deploy script with a few lines.
5
+ It executes automatically common tasks like migrate the database, install gems, package the assets, clean the cache, notify Hoptoad, restart the server, etc. This means you will not have a big deploy script calld 'recipe' like with other tools, only a simple deploy script with a few lines.
6
6
 
7
- It uses Git to version the deploys and to pull only the modifications in each one. This means you will not have a lot of folders in the server (only one) with duplicated code and that ech deploy will be very fast.
7
+ It uses Git to version the deploys and to pull or push only the modifications in each one. This means you will not have a lot of folders in the server (only one) with duplicated code and that ech deploy will be very fast.
8
8
 
9
- It is very flexible, meaning you can create templates specifing how specific tasks must behave. As today, there are templates for Locaweb and for Rails 3.
9
+ It is very flexible, meaning you can create templates specifing how specific tasks must behave. As today, there are templates for Locaweb, for Rails 3 using git pull and Rails 3 using git push.
10
10
 
11
- It works by default with Passenger, but you can specified another servers like Mongrel, Thin and Unicorn.
11
+ It works by default with Passenger, but you can specify another servers like Mongrel, Thin and Unicorn.
12
12
 
13
13
  You can execute Inploy from a remote machine or from the server machine, meaning anynone can go to the deployment path and with only one command update the code and execute all the tasks.
14
14
 
@@ -61,7 +61,7 @@ When using Inploy with Rake, there are five tasks:
61
61
  - migrates the database
62
62
  - updates the crontab from Whenever if being used
63
63
  - cleans the cache, default tmp/cache
64
- - cleans cached assets in public/assets if Jammit is installed
64
+ - cleans cached assets in public/assets if Jammit is installed
65
65
  - parses less files if more:parse tasks exists
66
66
  - package the assets if asset:packager:build_all task exists
67
67
  - notifies Hoptoad about the deploy, specifing the revision, repository and environment
@@ -77,7 +77,7 @@ When using Inploy with Rake, there are five tasks:
77
77
  - migrates the database
78
78
  - updates the crontab from Whenever if being used
79
79
  - cleans the cache, default tmp/cache
80
- - cleans cached assets in public/assets if Jammit is installed
80
+ - cleans cached assets in public/assets if Jammit is installed
81
81
  - parses less files if more:parse tasks exists
82
82
  - package the assets if asset:packager:build_all task exists
83
83
  - notifies Hoptoad about the deploy, specifing the revision, repository and environment
@@ -86,8 +86,9 @@ When using Inploy with Rake, there are five tasks:
86
86
 
87
87
  If you don't want to execute Rake, there are a few shortcuts:
88
88
 
89
- inploy = inploy update = rake inploy:remote:update
90
- inploy install from=url = rake inploy:remote:install from=url
89
+ inploy => inploy update => rake inploy:remote:update
90
+ inploy setup => rake inploy:remote:setup
91
+ inploy install from=url => rake inploy:remote:install from=url
91
92
 
92
93
  When using inploy as a command, it looks first for config/deploy.rb and then for deploy.rb .
93
94
 
@@ -95,8 +96,7 @@ h2. CONFIGURATION
95
96
 
96
97
  Create a config/deploy.rb file and configure it something like this:
97
98
 
98
- <pre><code>
99
- application = "signal"
99
+ <pre><code>application = "signal"
100
100
  repository = 'git://github.com/dcrec1/signal.git'
101
101
  hosts = ['hooters', 'geni']
102
102
 
@@ -125,6 +125,7 @@ Currently the steps available to skip are:
125
125
  - install_gems: skip rake gems:install
126
126
  - migrate_database: skip rake db:migrate
127
127
  - clear_cache: skip removing cache directories
128
+ - update_crontab: skip updating the crontab with Whenever
128
129
 
129
130
  * Usage (params are comma separated):
130
131
 
@@ -151,6 +152,7 @@ Inploy is brought to you by:
151
152
  * alekenji
152
153
  * Erik Dahlstrand
153
154
  * Carlos Brando
155
+ * Thomas Ritz
154
156
 
155
157
 
156
158
  h2. LICENSE:
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ require 'rake/gempackagetask'
5
5
  require 'spec/rake/spectask'
6
6
 
7
7
  GEM = "inploy"
8
- GEM_VERSION = "1.6.0"
8
+ GEM_VERSION = "1.6.1"
9
9
  SUMMARY = "Rails deployment made easy"
10
10
  AUTHOR = "Diego Carrion"
11
11
  EMAIL = "dc.rec1@gmail.com"
@@ -53,3 +53,9 @@ Spec::Rake::SpecTask.new('rcov') do |t|
53
53
  t.rcov = true
54
54
  t.rcov_opts = ['--no-html', '-T', '--exclude', 'spec']
55
55
  end
56
+
57
+ desc "Run specs with all the Ruby versions supported"
58
+ task :build do
59
+ system "rvm 1.8.7 specs"
60
+ system "rvm 1.9.2 specs"
61
+ end
data/bin/inploy CHANGED
File without changes
@@ -25,15 +25,14 @@ module Inploy
25
25
  end
26
26
 
27
27
  def configure
28
- if file = configuration_file
29
- deploy = self
30
- eval file.read
31
- local_variables.each do |variable|
32
- send "#{variable}=", eval(variable) rescue nil
33
- end
34
- end
28
+ configure_from configuration_file if configuration_file
29
+ end
30
+
31
+ def configure_from(file)
32
+ deploy = self
33
+ eval file.read + ';local_variables.each { |variable| deploy.send "#{variable}=", eval(variable.to_s) rescue nil }'
35
34
  end
36
-
35
+
37
36
  def remote_install(opts)
38
37
  remote_run "bash < <(wget -O- #{opts[:from]})"
39
38
  end
@@ -60,7 +59,7 @@ module Inploy
60
59
  end
61
60
 
62
61
  def local_update
63
- run "git pull origin #{branch}"
62
+ update_code
64
63
  after_update_code
65
64
  end
66
65
 
@@ -68,6 +67,10 @@ module Inploy
68
67
  @before_restarting_server = block
69
68
  end
70
69
 
70
+ def update_code
71
+ run "git pull origin #{branch}"
72
+ end
73
+
71
74
  private
72
75
 
73
76
  def after_update_code
@@ -75,7 +78,7 @@ module Inploy
75
78
  copy_sample_files
76
79
  install_gems
77
80
  migrate_database
78
- run "whenever --update-crontab #{application} --set 'environment=#{environment}'" if File.exists?("config/schedule.rb")
81
+ update_crontab
79
82
  clear_cache
80
83
  run "rm -R -f public/assets" if jammit_is_installed?
81
84
  rake_if_included "more:parse"
@@ -11,7 +11,7 @@ module Inploy
11
11
  def skip_steps_cmd
12
12
  " skip_steps=#{skip_steps.join(',')}" unless skip_steps.nil?
13
13
  end
14
-
14
+
15
15
  def clear_cache
16
16
  unless skip_step?('clear_cache')
17
17
  cache_dirs.each do |dir|
@@ -37,7 +37,7 @@ module Inploy
37
37
  end
38
38
 
39
39
  def copy_sample_files
40
- ["example", "sample"].each do |extension|
40
+ ["example", "sample"].each do |extension|
41
41
  Dir.glob("config/*.#{extension}").each do |file|
42
42
  secure_copy file, file.gsub(".#{extension}", '')
43
43
  end
@@ -55,5 +55,9 @@ module Inploy
55
55
  def install_gems
56
56
  rake "gems:install RAILS_ENV=#{environment}" unless skip_step?('install_gems')
57
57
  end
58
+
59
+ def update_crontab
60
+ run "whenever --update-crontab #{application} --set 'environment=#{environment}'" if File.exists?("config/schedule.rb") unless skip_step?('update_crontab')
61
+ end
58
62
  end
59
63
  end
@@ -5,7 +5,7 @@ module Inploy
5
5
  run "thin --pid tmp/pids/thin.pid stop"
6
6
  run "thin --rackup config.ru --daemonize\
7
7
  --log log/thin.log --pid tmp/pids/thin.pid --environment production\
8
- --port 4500 start"
8
+ --port 4500 start"
9
9
  end
10
10
  end
11
11
  end
@@ -0,0 +1,56 @@
1
+ module Inploy
2
+ module Templates
3
+ module Rails3Push
4
+
5
+ def remote_setup
6
+ command = []
7
+ command << "mkdir -p #{application_path}"
8
+ command << "cd #{application_path}"
9
+ command << "git init"
10
+ command << "sed -i'' -e 's/master/#{branch}/' .git/HEAD" unless branch == 'master'
11
+ command << "git config --bool receive.denyNonFastForwards false"
12
+ command << "git config receive.denyCurrentBranch ignore"
13
+ remote_run command.join(' && ')
14
+
15
+ push_code
16
+
17
+ command = []
18
+ command << "cd #{application_path}"
19
+ command << "rake inploy:local:setup environment=#{environment}#{skip_steps_cmd}"
20
+ remote_run command.join(' && ')
21
+ end
22
+
23
+ def remote_update
24
+ push_code
25
+
26
+ command = []
27
+ command << "cd #{application_path}"
28
+ command << "rake inploy:local:update environment=#{environment}#{skip_steps_cmd}"
29
+ remote_run command.join(' && ')
30
+ end
31
+
32
+ def install_gems
33
+ end
34
+
35
+ def update_code
36
+ end
37
+
38
+ private
39
+
40
+ def push_code
41
+ hosts.each do |host|
42
+ run "git push -f #{user}@#{host}:#{application_path} #{branch}"
43
+ end
44
+
45
+ command = []
46
+ command << "cd #{application_path}"
47
+ command << "git reset --hard"
48
+ command << "git clean -f -d"
49
+ command << "git submodule update --init"
50
+ command << "bundle install"
51
+ remote_run command.join(' && ')
52
+ end
53
+
54
+ end
55
+ end
56
+ end
@@ -31,7 +31,7 @@ namespace :inploy do
31
31
  end
32
32
 
33
33
  desc "Remote Update"
34
- task :update do
34
+ task :update do
35
35
  deploy.remote_update
36
36
  end
37
37
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 6
8
- - 0
9
- version: 1.6.0
8
+ - 1
9
+ version: 1.6.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Diego Carrion
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-17 00:00:00 -03:00
17
+ date: 2010-06-12 00:00:00 -03:00
18
18
  default_executable:
19
19
  dependencies: []
20
20
 
@@ -37,6 +37,7 @@ files:
37
37
  - lib/inploy/servers/unicorn.rb
38
38
  - lib/inploy/templates/locaweb.rb
39
39
  - lib/inploy/templates/rails3.rb
40
+ - lib/inploy/templates/rails3_push.rb
40
41
  - lib/inploy.rb
41
42
  - lib/tasks/inploy.rake
42
43
  - bin/inploy
@@ -52,6 +53,7 @@ rdoc_options: []
52
53
  require_paths:
53
54
  - lib
54
55
  required_ruby_version: !ruby/object:Gem::Requirement
56
+ none: false
55
57
  requirements:
56
58
  - - ">="
57
59
  - !ruby/object:Gem::Version
@@ -59,6 +61,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
59
61
  - 0
60
62
  version: "0"
61
63
  required_rubygems_version: !ruby/object:Gem::Requirement
64
+ none: false
62
65
  requirements:
63
66
  - - ">="
64
67
  - !ruby/object:Gem::Version
@@ -68,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
71
  requirements: []
69
72
 
70
73
  rubyforge_project: inploy
71
- rubygems_version: 1.3.6
74
+ rubygems_version: 1.3.7
72
75
  signing_key:
73
76
  specification_version: 3
74
77
  summary: Rails deployment made easy