mobilize-ssh 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -2
- data/lib/mobilize-ssh/handlers/ssh.rb +2 -1
- data/lib/mobilize-ssh/version.rb +1 -1
- data/test/ssh_job_rows.yml +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -125,10 +125,12 @@ Start
|
|
125
125
|
### Create Job
|
126
126
|
|
127
127
|
* For mobilize-ssh, the following task is available:
|
128
|
-
* ssh.run
|
128
|
+
* ssh.run `node: <node_alias>, cmd: <command>, su_user: su_user, sources:[*<gsheet_full_paths>]`, which reads
|
129
129
|
all gsheets, copies them to a temporary folder on the selected node, and
|
130
130
|
runs the command inside that folder.
|
131
|
-
*
|
131
|
+
* su_user and sources are optional; node and cmd are required. su_user
|
132
|
+
will cause the command to be prefixed with sudo su <su_user> -c.
|
133
|
+
* The test uses `ssh.run node:"test_node", cmd:"ruby code.rb", su_user: "root", sources:["Runner_mobilize(test)/code.rb","Runner_mobilize(test)/code.sh"]`
|
132
134
|
|
133
135
|
<a name='section_Start_Run_Test'></a>
|
134
136
|
### Run Test
|
@@ -146,7 +146,8 @@ module Mobilize
|
|
146
146
|
gdrive_slot = Gdrive.slot_worker_by_path(task_path)
|
147
147
|
Ssh.get_file_hash(params['sources'],gdrive_slot)
|
148
148
|
end
|
149
|
-
|
149
|
+
su_user = t.params['su_user']
|
150
|
+
Ssh.run(node,command,file_hash,su_user)
|
150
151
|
end
|
151
152
|
end
|
152
153
|
end
|
data/lib/mobilize-ssh/version.rb
CHANGED
data/test/ssh_job_rows.yml
CHANGED
@@ -2,5 +2,5 @@
|
|
2
2
|
active: true
|
3
3
|
trigger: once
|
4
4
|
status: ""
|
5
|
-
task1: 'ssh.run node:"test_node", cmd:"ruby code.rb", sources:["Runner_mobilize(test)/code.rb", "Runner_mobilize(test)/code.sh"]'
|
5
|
+
task1: 'ssh.run node:"test_node", cmd:"ruby code.rb", su_user:"root", sources:["Runner_mobilize(test)/code.rb", "Runner_mobilize(test)/code.sh"]'
|
6
6
|
task2: 'gsheet.write source:"task1", target:"Runner_mobilize(test)/test_ssh.out"'
|