I am trying to run the informatica workflows thru ruby. Using the Net-ssh gem. When i run my test it gets passed but my jobs are not triggered when i check the logs they are not creating.
Below is my code.
Given(/^Run ESP jobs$/) do
require 'net/ssh'
Net::SSH.start('host', 'user', :password => "my_password" ) do
# I am trying to connect to remote server.
ssh.exec('cd /etl/dev/scripts/bin')
puts ssh.exec('pwd')
# After changing the directory i tried to see my path but my path still
# shows in the home
# below command is in this path "/etl/dev/scripts/bin"
ssh.exec('startworkflow01.ksh folder_name workflow_name')
end
end
I expect to run the job. Please provide me your suggestions in completing this task. Thanks for your valuable time.
Neither
execnorexec!will preserve state between calls, since those commands are not running on top of a shell like Bash or Zsh.Therefore to run a script in a certain folder you either have to address the script with an absolute path:
Or string related commands together with
;in the sameexeccall, to preserve state:If you want to run everything on top of a real shell, then it gets more complicated. I recommend to look here for more details on that:
ruby net-ssh login shell