Reputation: 1421
Following is the snippet
stage('Git checkout') {
steps {
git branch: '${params.branchName}', url: 'my_git_repository_url.git'
}
}
Upon execution, I get the following error
Running in Durability level: MAX_SURVIVABILITY
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: 18: Invalid parameter "branch", did you mean "name"? @ line 18, column 13.
git branch: 'name_of_git_branch', url: 'https://my_git_repository_url.git'
^
WorkflowScript: 18: Invalid parameter "url", did you mean "name"? @ line 18, column 44.
ranch: 'bas-download-breaks', url: 'http
^
I have git & workflow-aggregator plugin installed in jenkins server. Any leads about such an issue would help.
Upvotes: 1
Views: 922
Reputation: 1421
Problem here was that the workflow-aggregator:2.6 has a dependency on git-client plugin. Plugin 'git' was installed manually after the jenkins was booted up with workflow-aggregator and the server was never restarted after manual installation of git.
So, pipeilne assumed the usage git-client
instead of git
plugin. After the jenkins was restarted, the git plugin worked and above mentioned step to checkout worked.
Since this is different from the only answer proposed at the time of finding, I am posting this finding as it worked for me.
Upvotes: 2