In my Jenkins declarative pipeline I have the following:
pipeline {
stages {
stage('Checkout') {
// clone using git
}
stage('Merge') {
// need to merge dev to master
merge()
}
}
}
def merge() {
sshagent(credentials : ['git-credentials-id']) {
sh "git push origin master"
}
when running the pipeline I get the following exception:
java.lang.NoSuchMethodError: No such DSL method 'sshagent' found among steps?
You just need to install SSH Agent Jenkins plugin .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.