Skip to content

Instantly share code, notes, and snippets.

@int128
Last active August 29, 2015 14:07
Show Gist options
  • Save int128/4fe93cbd8b58302e25b2 to your computer and use it in GitHub Desktop.
Save int128/4fe93cbd8b58302e25b2 to your computer and use it in GitHub Desktop.
ssh {
outputLogLevel = LogLevel.LIFECYCLE
}
task example(type: SshTask) {
session(remotes.localhost) {
execute 'uname -a'
execute 'secret', logging: false
execute 'dmesg > /tmp/dmesg'
get '/tmp/dmesg', '.'
}
}
ssh.settings {
outputStream = System.out
}
ssh.run {
session(remotes.localhost) {
execute 'uname -a'
execute 'secret', logging: false
new File('dmesg').withOutputStream { stream ->
execute 'dmesg', outputStream: stream
}
}
}
ssh.settings {
logging = 'stdio'
}
ssh.run {
session(remotes.localhost) {
execute 'uname -a'
execute 'secret', logging: 'none'
new File('dmesg').withOutputStream { stream ->
execute 'dmesg', outputStream: stream
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment