Skip to content

Commit

Permalink
Fix scp task to use public key authentication, password is not allowe…
Browse files Browse the repository at this point in the history
…d anymore
  • Loading branch information
kaosko committed Nov 20, 2014
1 parent f73e8b2 commit 1956c56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ssh.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ class SshTask extends DefaultTask {
def scpFile(source, destination) {
initAnt()
withInfoLogging {
ant.scp(localFile: project.files(source).singleFile, remoteToFile: "${userName}@${host}:${destination}", password: password, verbose: verbose)
ant.scp(localFile: project.files(source).singleFile, remoteToFile: "${userName}@${host}:${destination}", keyfile : "${System.properties['user.home']}/.ssh/id_dsa", verbose: verbose)
}
}

def scpDir(source, destination) {
initAnt()
withInfoLogging {
ant.sshexec(host: host, username: userName, password: password, command: "mkdir -p ${destination}")
ant.scp(remoteTodir: "${userName}@${host}:${destination}", password: password, verbose: verbose) {
ant.scp(remoteTodir: "${userName}@${host}:${destination}", keyfile : "${System.properties['user.home']}/.ssh/id_dsa", verbose: verbose) {
project.files(source).addToAntBuilder(ant, "fileSet", FileCollection.AntType.FileSet)
}
}
Expand Down

0 comments on commit 1956c56

Please sign in to comment.