inploy 1.9 → 1.9.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -70,8 +70,10 @@ When using Inploy with Rake, there are five tasks:
70
70
  - updates the crontab from Whenever if being used
71
71
  - cleans the cache, default tmp/cache
72
72
  - cleans cached assets in public/assets if Jammit is installed
73
- - parses less files if more:parse tasks exists
73
+ - starts the Delayed Job worker if script/delayed_job exist
74
+ - parses less files if more:parse task exists
74
75
  - parses compass files if config/initializers/compass.rb exists
76
+ - parses coffeescript files with Barista if barista:brew task exist
75
77
  - package the assets if asset:packager:build_all task exists
76
78
  - notifies Hoptoad about the deploy, specifing the revision, repository and environment
77
79
  - notifies NewRelic RPM about the deploy
@@ -87,8 +89,10 @@ When using Inploy with Rake, there are five tasks:
87
89
  - updates the crontab from Whenever if being used
88
90
  - cleans the cache, default tmp/cache
89
91
  - cleans cached assets in public/assets if Jammit is installed
90
- - parses less files if more:parse tasks exists
92
+ - restarts the Delayed Job worker if script/delayed_job exists
93
+ - parses less files if more:parse task exists
91
94
  - parses compass files if config/initializers/compass.rb exists
95
+ - parses coffeescript files with Barista if barista:brew task exist
92
96
  - package the assets if asset:packager:build_all task exists
93
97
  - notifies Hoptoad about the deploy, specifing the revision, repository and environment
94
98
  - notifies NewRelic RPM about the deploy
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ require 'rake/gempackagetask'
5
5
  require 'rspec/core/rake_task'
6
6
 
7
7
  GEM = "inploy"
8
- GEM_VERSION = "1.9"
8
+ GEM_VERSION = "1.9.1"
9
9
  SUMMARY = "Rails and Sinatra deployment made easy"
10
10
  AUTHOR = "Diego Carrion"
11
11
  EMAIL = "dc.rec1@gmail.com"
@@ -3,8 +3,7 @@ module Inploy
3
3
  include Helper
4
4
  include DSL
5
5
 
6
- attr_accessor :repository, :user, :application, :hosts, :path, :app_folder, :ssh_opts, :branch, :environment,
7
- :port, :skip_steps, :cache_dirs, :sudo, :login_shell
6
+ attr_accessor :repository, :user, :application, :hosts, :path, :app_folder, :ssh_opts, :branch, :environment, :port, :skip_steps, :cache_dirs, :sudo, :login_shell
8
7
 
9
8
  define_callbacks :after_setup, :before_restarting_server
10
9
 
@@ -31,7 +30,7 @@ module Inploy
31
30
  configure_from configuration_file if configuration_file
32
31
  end
33
32
 
34
- def configure_from(file)
33
+ def configure_from(file)
35
34
  deploy = self
36
35
  eval file.read + ';local_variables.each { |variable| deploy.send "#{variable}=", eval(variable.to_s) rescue nil }'
37
36
  end
@@ -41,7 +40,7 @@ module Inploy
41
40
  end
42
41
 
43
42
  def remote_setup
44
- remote_run "cd #{path} && #{@sudo}git clone --depth 1 #{repository} #{application} && cd #{application_folder} #{checkout}#{bundle} && #{@sudo}rake inploy:local:setup RAILS_ENV=#{environment} environment=#{environment}#{skip_steps_cmd}"
43
+ remote_run "cd #{path} && #{sudo_if_should}git clone --depth 1 #{repository} #{application} && cd #{application_folder} #{checkout}#{bundle} && #{sudo_if_should}rake inploy:local:setup RAILS_ENV=#{environment} environment=#{environment}#{skip_steps_cmd}"
45
44
  end
46
45
 
47
46
  def local_setup
@@ -54,7 +53,7 @@ module Inploy
54
53
  end
55
54
 
56
55
  def remote_update
57
- remote_run "cd #{application_path} && #{@sudo}rake inploy:local:update RAILS_ENV=#{environment} environment=#{environment}#{skip_steps_cmd}"
56
+ remote_run "cd #{application_path} && #{sudo_if_should}rake inploy:local:update RAILS_ENV=#{environment} environment=#{environment}#{skip_steps_cmd}"
58
57
  end
59
58
 
60
59
  def remote_rake(task)
@@ -92,12 +91,13 @@ module Inploy
92
91
  update_crontab
93
92
  clear_cache
94
93
  run "rm -R -f public/assets" if jammit_is_installed?
94
+ run "RAILS_ENV=#{environment} script/delayed_job restart" if file_exists?("script/delayed_job")
95
95
  rake_if_included "more:parse"
96
96
  run "compass compile" if file_exists?("config/initializers/compass.rb")
97
97
  rake_if_included "barista:brew"
98
98
  rake_if_included "asset:packager:build_all"
99
99
  rake_if_included "hoptoad:deploy RAILS_ENV=#{environment} TO=#{environment} REPO=#{repository} REVISION=#{`git log | head -1 | cut -d ' ' -f 2`}"
100
- ruby_if_exists "vendor/plugins/newrelic_rpm/bin/newrelic_cmd", :params => "deployments"
100
+ notify_new_relic
101
101
  callback :before_restarting_server
102
102
  restart_server
103
103
  end
@@ -75,5 +75,13 @@ module Inploy
75
75
  def update_crontab
76
76
  run "whenever --update-crontab #{application} --set 'environment=#{environment}'" if file_exists?("config/schedule.rb") unless skip_step?('update_crontab')
77
77
  end
78
+
79
+ def notify_new_relic
80
+ if file_exists? "vendor/plugins/newrelic_rpm/bin/newrelic_cmd"
81
+ run "ruby vendor/plugins/newrelic_rpm/bin/newrelic_cmd deployments"
82
+ elsif file_exists? "config/newrelic.yml"
83
+ run "newrelic_cmd deployments"
84
+ end
85
+ end
78
86
  end
79
87
  end
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inploy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
5
- prerelease: false
4
+ hash: 49
5
+ prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 9
9
- version: "1.9"
9
+ - 1
10
+ version: 1.9.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Diego Carrion
@@ -14,7 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2011-01-06 00:00:00 -02:00
18
+ date: 2011-03-25 00:00:00 -03:00
18
19
  default_executable:
19
20
  dependencies: []
20
21
 
@@ -76,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
77
  requirements: []
77
78
 
78
79
  rubyforge_project: inploy
79
- rubygems_version: 1.3.7
80
+ rubygems_version: 1.5.3
80
81
  signing_key:
81
82
  specification_version: 3
82
83
  summary: Rails and Sinatra deployment made easy