remoting 0.2.10 → 0.2.11
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +15 -5
- data/VERSION +1 -1
- data/remoting.gemspec +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -33,6 +33,7 @@ Just require `remoting/task` inside your tasks. NOTE: you can also require it gl
|
|
33
33
|
|
34
34
|
_ex._
|
35
35
|
|
36
|
+
``` rb
|
36
37
|
desc "Restart the server"
|
37
38
|
task :restart do
|
38
39
|
require 'remoting/task'
|
@@ -43,13 +44,15 @@ _ex._
|
|
43
44
|
end
|
44
45
|
|
45
46
|
end
|
47
|
+
```
|
46
48
|
|
47
49
|
Methods invoked inside the `remote` block are executed inside a ssh session. `remote` takes two arguments: `name` and `login`. `name` serves only for logging purposal while `login` is the login string to access the server supplied in the form of `user@host`
|
48
50
|
|
49
51
|
### DSL
|
50
52
|
|
51
53
|
By examples
|
52
|
-
|
54
|
+
|
55
|
+
``` rb
|
53
56
|
remote("my task", config.login) do
|
54
57
|
|
55
58
|
ps("aux") | grep("mysql")
|
@@ -59,11 +62,13 @@ By examples
|
|
59
62
|
command("[[ -f \"path\" ]] && run_a_command")
|
60
63
|
|
61
64
|
end
|
65
|
+
```
|
62
66
|
|
63
67
|
### Local Tasks using DSL
|
64
68
|
|
65
69
|
You can also define local tasks using the same DSL
|
66
70
|
|
71
|
+
``` rb
|
67
72
|
desc "Setup git origin"
|
68
73
|
task :init do
|
69
74
|
require 'remoting/task'
|
@@ -73,6 +78,7 @@ You can also define local tasks using the same DSL
|
|
73
78
|
git :remote, :add, :origin, config.repo
|
74
79
|
end
|
75
80
|
end
|
81
|
+
```
|
76
82
|
|
77
83
|
Methods invoked inside the `local` block are executed locally. `local` takes only the `name` parameter.
|
78
84
|
|
@@ -82,7 +88,8 @@ Methods invoked inside the `local` block are executed locally. `local` takes onl
|
|
82
88
|
Invoking `remote` with `:interactive => true` will tell `remote` to yield the process to ssh, this way you will remotely interact with the server. On the other side everithing that is supposed to be executed after `remote` wont run. Despite this interactive tasks are very useful.
|
83
89
|
|
84
90
|
#### Example 1. Rails remote console (by popular demand):
|
85
|
-
|
91
|
+
|
92
|
+
``` rb
|
86
93
|
# my_remote_task.rake
|
87
94
|
|
88
95
|
desc "Open rails console on server"
|
@@ -95,9 +102,11 @@ Invoking `remote` with `:interactive => true` will tell `remote` to yield the pr
|
|
95
102
|
bundle :exec, "rails c production"
|
96
103
|
end
|
97
104
|
end
|
105
|
+
```
|
98
106
|
|
99
107
|
#### Example 2. Reloading Apache configuration (involves sudo):
|
100
|
-
|
108
|
+
|
109
|
+
``` rb
|
101
110
|
task :reload do
|
102
111
|
require 'remoting/task'
|
103
112
|
|
@@ -105,12 +114,13 @@ Invoking `remote` with `:interactive => true` will tell `remote` to yield the pr
|
|
105
114
|
sudo "/etc/init.d/apache2 reload"
|
106
115
|
end
|
107
116
|
end
|
108
|
-
|
117
|
+
```
|
109
118
|
|
110
119
|
## A note on modularity
|
111
120
|
|
112
121
|
A complete deployment manager (like Capistrano even if probably not as good as it is) can be easily built over *remoting*. Capistrano recipes can be ordinary rake tasks packed as gems. Plus various _deployment strategies_ can be assembled as dependencies of a main `deploy` task.
|
113
122
|
|
123
|
+
``` rb
|
114
124
|
# Gemfile
|
115
125
|
gem 'remoting_scm_git' # provides 'remoting:scm:push, remoting:scm:update_remoting_code'
|
116
126
|
gem 'remoting_server_passenger' # provides 'remoting:server:restart'
|
@@ -119,7 +129,7 @@ A complete deployment manager (like Capistrano even if probably not as good as i
|
|
119
129
|
desc "Deploy application on server"
|
120
130
|
task :deploy => ["remoting:scm:push", "remoting:scm:update_remoting_code", "remoting:bundle", "remoting:server:restart"] do
|
121
131
|
end
|
122
|
-
|
132
|
+
```
|
123
133
|
|
124
134
|
## Examples
|
125
135
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.11
|
data/remoting.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remoting
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.11
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -105,7 +105,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
105
105
|
version: '0'
|
106
106
|
segments:
|
107
107
|
- 0
|
108
|
-
hash:
|
108
|
+
hash: 3696629613796511813
|
109
109
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
110
|
none: false
|
111
111
|
requirements:
|