Capistrano 3 / SSHKit.config.umask not working

331 Views Asked by At

I'm trying to run a test command with SSHKit.config.umask configured:

deploy.rb:

SSHKit.config.umask = '777'

deploy.rake

namespace :deploy do
  task :test do
    on roles :web do
      execute('touch ~/hello.txt')
    end
  end
end

I expect hello.txt to be configures with no permissions, but I see:

-rw-rw-r-- 1 deploy deploy 0 Apr 9 15:40 hello.txt

What am I doing wrong?

1

There are 1 best solutions below

0
On

I needed to use the following syntax to that the command was executed via the command map:

execute(:touch, '~/hello.txt')

Now the permissions are correct:

---------- 1 deploy deploy 0 Apr 9 15:44 hello.txt