mobilize-ssh 1.0.65 → 1.0.71
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -2
- data/lib/mobilize-ssh/handlers/ssh.rb +11 -11
- data/lib/mobilize-ssh/{rakes.rb → tasks.rb} +0 -0
- data/lib/mobilize-ssh/version.rb +1 -1
- data/mobilize-ssh.gemspec +1 -1
- data/test/ssh_job_rows.yml +6 -6
- metadata +5 -5
data/Rakefile
CHANGED
@@ -126,18 +126,18 @@ module Mobilize
|
|
126
126
|
return tmp_file_path
|
127
127
|
end
|
128
128
|
|
129
|
-
def Ssh.
|
129
|
+
def Ssh.file_hash_by_stage_path(stage_path)
|
130
130
|
#this is not meant to be called directly
|
131
|
-
#from the Runner -- it's used by
|
132
|
-
|
133
|
-
params =
|
131
|
+
#from the Runner -- it's used by run_by_stage_path
|
132
|
+
s = Stage.where(:path=>stage_path).first
|
133
|
+
params = s.params
|
134
134
|
gsheet_paths = if params['sources']
|
135
135
|
params['sources']
|
136
136
|
elsif params['source']
|
137
137
|
[params['source']]
|
138
138
|
end
|
139
139
|
if gsheet_paths and gsheet_paths.length>0
|
140
|
-
gdrive_slot = Gdrive.slot_worker_by_path(
|
140
|
+
gdrive_slot = Gdrive.slot_worker_by_path(stage_path)
|
141
141
|
file_hash = {}
|
142
142
|
gsheet_paths.map do |gpath|
|
143
143
|
string = Gsheet.find_by_path(gpath,gdrive_slot).to_tsv
|
@@ -146,17 +146,17 @@ module Mobilize
|
|
146
146
|
end.each do |f|
|
147
147
|
file_hash = f.merge(file_hash)
|
148
148
|
end
|
149
|
-
Gdrive.unslot_worker_by_path(
|
149
|
+
Gdrive.unslot_worker_by_path(stage_path)
|
150
150
|
return file_hash
|
151
151
|
end
|
152
152
|
end
|
153
153
|
|
154
|
-
def Ssh.
|
155
|
-
|
156
|
-
params =
|
154
|
+
def Ssh.run_by_stage_path(stage_path)
|
155
|
+
s = Stage.where(:path=>stage_path).first
|
156
|
+
params = s.params
|
157
157
|
node, command = [params['node'],params['cmd']]
|
158
|
-
file_hash = Ssh.
|
159
|
-
su_user =
|
158
|
+
file_hash = Ssh.file_hash_by_stage_path(stage_path)
|
159
|
+
su_user = s.params['su_user']
|
160
160
|
Ssh.run(node,command,file_hash,su_user)
|
161
161
|
end
|
162
162
|
end
|
File without changes
|
data/lib/mobilize-ssh/version.rb
CHANGED
data/mobilize-ssh.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
18
|
gem.require_paths = ["lib"]
|
19
|
-
gem.add_runtime_dependency "mobilize-base","1.0.
|
19
|
+
gem.add_runtime_dependency "mobilize-base","1.0.81"
|
20
20
|
gem.add_runtime_dependency "net-ssh"
|
21
21
|
gem.add_runtime_dependency "net-scp"
|
22
22
|
gem.add_runtime_dependency "net-ssh-gateway"
|
data/test/ssh_job_rows.yml
CHANGED
@@ -2,17 +2,17 @@
|
|
2
2
|
active: true
|
3
3
|
trigger: once
|
4
4
|
status: ""
|
5
|
-
|
6
|
-
|
5
|
+
stage1: 'ssh.run node:"test_node", cmd:"ruby code.rb", su_user:"root", sources:["Runner_mobilize(test)/code.rb", "Runner_mobilize(test)/code.sh"]'
|
6
|
+
stage2: 'gsheet.write source:"stage1", target:"Runner_mobilize(test)/test_ssh_1.out"'
|
7
7
|
- name: test_ssh_2
|
8
8
|
active: true
|
9
9
|
trigger: once
|
10
10
|
status: ""
|
11
|
-
|
12
|
-
|
11
|
+
stage1: 'ssh.run node:"test_node", cmd:"sh code.sh", su_user:"root", source:"Runner_mobilize(test)/code.sh"'
|
12
|
+
stage2: 'gsheet.write source:"stage1", target:"Runner_mobilize(test)/test_ssh_2.out"'
|
13
13
|
- name: test_ssh_3
|
14
14
|
active: true
|
15
15
|
trigger: once
|
16
16
|
status: ""
|
17
|
-
|
18
|
-
|
17
|
+
stage1: 'ssh.run node:"test_node", cmd:"whoami"'
|
18
|
+
stage2: 'gsheet.write source:"stage1", target:"Runner_mobilize(test)/test_ssh_3.out"'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mobilize-ssh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.71
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mobilize-base
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.0.
|
21
|
+
version: 1.0.81
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - '='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 1.0.
|
29
|
+
version: 1.0.81
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: net-ssh
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -93,7 +93,7 @@ files:
|
|
93
93
|
- lib/mobilize-ssh/extensions/socket.rb
|
94
94
|
- lib/mobilize-ssh/extensions/string.rb
|
95
95
|
- lib/mobilize-ssh/handlers/ssh.rb
|
96
|
-
- lib/mobilize-ssh/
|
96
|
+
- lib/mobilize-ssh/tasks.rb
|
97
97
|
- lib/mobilize-ssh/version.rb
|
98
98
|
- lib/samples/ssh.yml
|
99
99
|
- mobilize-ssh.gemspec
|