0

I'm painfully new to Jenkins so I'm sorry for the silly question. I'm trying to get my jenkins to publish my .jar via SSH using the following:

sshPublisher(publishers: [sshPublisherDesc(configName: 'Tech-O-Dex-API', transfers: [sshTransfer(excludes: '', execCommand: 'ssh -i D:\\Work\\KeyPairs\\Deploy\\Tech-O-Dex-APII -n -f ec2-user@ec2-<IP>.compute-1.amazonaws.com "sh -c \'cd ~/; java -jar Tech-O-Dex-0.1.0.jar /dev/null &\\\'"', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '', remoteDirectorySDF: false, removePrefix: '', sourceFiles: ' \'target/*.jar\'')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])

however, I'm getting the following error:

Warning: Identity file D:WorkKeyPairsDeployTech-O-Dex-API not accessible: No such file or directory.

I've tried specifying the key file, pem and ppk, nothing works? The file exists becasue I can use

scp -i D:\Work\KeyPairs\Tech-O-Dex-API D:\Jenkins\workspace\Tech-O-Dex\target\Tech-O-Dex-0.1.0.jar ec2-user@ec2-<IP>.compute-1.amazonaws.com:~/

inf the cmd line and it works fine to my EC2?

I'm on a windows machine which I'm almost positive is what is causing all of these headaches haha. Any help would be appreciated. Thanks

sources tried reference: Can't ssh to AWS EC2: Identity file not accessible

Talha Junaid
  • 2,351
  • 20
  • 29
Billy
  • 1,049
  • 3
  • 14
  • 23
  • Looks like backslashes are still dropped. Either try forward slashes or `\\\\` – StephenKing Aug 15 '18 at 06:06
  • hmm I've tried switching the slashes at got `Warning: Identity file D:/Work/KeyPairs/Deploy/Tech-O-Dex-API not accessible: No such file or directory.`? https://github.com/BillyCharter87/Tech-O-Dex-API/blob/7e84d3a9b5cb2ceb654ce1353cae5588bd468937/Jenkinsfile#L17 – Billy Aug 15 '18 at 13:55
  • I've tried moving the key file to my jenkins location also, no luck it seems yet. – Billy Aug 15 '18 at 22:33
  • I notice i get the same error even if I delete the entire file outright also. – Billy Aug 15 '18 at 23:09

0 Answers0