inploy 1.6.7 → 1.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +1 -1
- data/lib/inploy/deploy.rb +5 -6
- data/lib/inploy/dsl.rb +19 -0
- metadata +3 -3
data/Rakefile
CHANGED
data/lib/inploy/deploy.rb
CHANGED
@@ -4,7 +4,9 @@ module Inploy
|
|
4
4
|
include DSL
|
5
5
|
|
6
6
|
attr_accessor :repository, :user, :application, :hosts, :path, :ssh_opts, :branch, :environment,
|
7
|
-
|
7
|
+
:port, :skip_steps, :cache_dirs, :sudo
|
8
|
+
|
9
|
+
define_callbacks :after_setup, :before_restarting_server
|
8
10
|
|
9
11
|
def initialize
|
10
12
|
self.server = :passenger
|
@@ -47,6 +49,7 @@ module Inploy
|
|
47
49
|
rake "db:create RAILS_ENV=#{environment}"
|
48
50
|
run "./init.sh" if file_exists?("init.sh")
|
49
51
|
after_update_code
|
52
|
+
callback :after_setup
|
50
53
|
end
|
51
54
|
|
52
55
|
def remote_update
|
@@ -62,10 +65,6 @@ module Inploy
|
|
62
65
|
after_update_code
|
63
66
|
end
|
64
67
|
|
65
|
-
def before_restarting_server(&block)
|
66
|
-
@before_restarting_server = block
|
67
|
-
end
|
68
|
-
|
69
68
|
def update_code
|
70
69
|
run "git pull origin #{branch}"
|
71
70
|
end
|
@@ -93,7 +92,7 @@ module Inploy
|
|
93
92
|
rake_if_included "asset:packager:build_all"
|
94
93
|
rake_if_included "hoptoad:deploy RAILS_ENV=#{environment} TO=#{environment} REPO=#{repository} REVISION=#{`git log | head -1 | cut -d ' ' -f 2`}"
|
95
94
|
ruby_if_exists "vendor/plugins/newrelic_rpm/bin/newrelic_cmd", :params => "deployments"
|
96
|
-
|
95
|
+
callback :before_restarting_server
|
97
96
|
restart_server
|
98
97
|
end
|
99
98
|
end
|
data/lib/inploy/dsl.rb
CHANGED
@@ -1,5 +1,24 @@
|
|
1
1
|
module Inploy
|
2
2
|
module DSL
|
3
|
+
module ClassMethods
|
4
|
+
def define_callbacks(*callbacks)
|
5
|
+
callbacks.each do |callback|
|
6
|
+
define_method callback do |&block|
|
7
|
+
instance_variable_set "@#{callback}", block
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.included(base)
|
14
|
+
base.extend ClassMethods
|
15
|
+
end
|
16
|
+
|
17
|
+
def callback(name)
|
18
|
+
instance_variable = instance_variable_get("@#{name.to_s}")
|
19
|
+
instance_eval(&instance_variable) unless instance_variable.nil?
|
20
|
+
end
|
21
|
+
|
3
22
|
def create_folder(path)
|
4
23
|
run "mkdir -p #{path}"
|
5
24
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 6
|
8
|
-
-
|
9
|
-
version: 1.6.
|
8
|
+
- 8
|
9
|
+
version: 1.6.8
|
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-08-
|
17
|
+
date: 2010-08-18 00:00:00 -03:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|