1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00
capistrano/docs/documentation/advanced-features/ssh-kit/index.markdown
2016-08-23 18:04:57 -07:00

967 B

title layout
Remote commands with SSH Kit default

Capistrano executes commands on remote servers using SSHKit.

An example setting a working directory, user and environment variable:

on roles(:app), in: :sequence, wait: 5 do
  within "/opt/sites/example.com" do
    # commands in this block execute in the
    # directory: /opt/sites/example.com
    as :deploy  do
      # commands in this block execute as the "deploy" user.
      with rails_env: :production do
        # commands in this block execute with the environment
        # variable RAILS_ENV=production
        rake   "assets:precompile"
        runner "S3::Sync.notify"
      end
    end
  end
end

For more examples, see the EXAMPLES.md file in the SSHKit project:

https://github.com/capistrano/sshkit/blob/master/EXAMPLES.md