mobilize-ssh 1.0.4 → 1.0.5

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/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 `<node_alias>,<command>,*<gsheet_full_paths>`, which reads
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
- * The test uses `ssh.run node:"test_node", cmd:"ruby code.rb",sources:["Runner_mobilize(test)/code.rb","Runner_mobilize(test)/code.sh"]`
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
- Ssh.run(node,command,file_hash)
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
@@ -1,5 +1,5 @@
1
1
  module Mobilize
2
2
  module Ssh
3
- VERSION = "1.0.4"
3
+ VERSION = "1.0.5"
4
4
  end
5
5
  end
@@ -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"'
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
4
+ version: 1.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: