java.lang.NoSuchMethodError: No such DSL method 'publishOverSsh' found among steps [archive, bat, build, catchError, checkout, deleteDir, dir, dockerFingerprintFrom, dockerFingerprintRun, echo, emailext, emailextrecipients, envVarsForTool, error, fileExists, getContext, git, input, isUnix, libraryResource, load, mail, milestone, node, parallel, properties, pwd, readFile, readTrusted, resolveScm, retry, script, sh, sleep, stage, stash, step, svn, timeout, timestamps, tool, unarchive, unstash, waitUntil, withContext, withCredentials, withDockerContainer, withDockerRegistry, withDockerServer,
Jenkins – how to use publish over ssh on Jenkinsfile and scp using groovy SDL on Jenkinsfile
Jenkinsjenkins-2
Best Answer
I used SCP and SSH on remote machine using Jenkins groovy DSL, using Sh:shell script.
Before that use
ssh-keygen
to create connection between host machine and Jenkins for password less authentication.For SSH login without password:
1) create ssh public and private key using ssh-keygen with this command:
2) Copy the public key to remote-host in .
ssh/authorized_keys
file.3) Now login to remote machine with out password.
Now to publish package to remote server use below command in Jenkinsfile script box :