Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

within release_path do; execute "tar zxf /tmp/test.gz"; end appears to untar test.gz in $HOME #265

Closed
vrsean opened this issue Jul 17, 2015 · 1 comment

Comments

@vrsean
Copy link

vrsean commented Jul 17, 2015

This behavior seems counter-intuitive given within. The problem was resolved with setting the -C argument to release_path for tar but stumped me a bit. execute "pwd" indicated the proper directly, oddly enough.

The code was executed within the context of on roles(:assets) do |host|...basically we are speeding up asset deployment by forking off the compilation of assets in the beginning, tarring up public/assets, and scping that file to /tmp in another task to give some background on the issue.

We are using sshkit 1.5.1.

Can anyone duplicate this issue or shed some light on it?

Thanks,

--sean

@leehambley
Copy link
Member

Please re-read this:

Note: In SSHKit, the first parameter of the execute / test / capture methods has a special significance. If the first parameter isn't a Symbol, SSHKit assumes that you want to execute the raw command and the as / within / with methods, SSHKit.config.umask and the command map have no effect.

That means you must call:

within release_path do
  execute :tar, '-zxf', '/tmp/test.gz'
end 

Not:

within release_path do
  execute "tar zxf /tmp/test.gz"
end 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants