Reputation: 103
How do we achieve Git Additional Behavior in Jenkins pipeline?
Additional Behaviors
=> checkout to specific local branch
Upvotes: 5
Views: 8380
Reputation: 688
you can find the pipeline syntax in your Jenkins job slide bar Pipeline Syntax section.
1、Sample Step select checkout: Check out from version control
2、click Additional Behaviours Add button
3、select checkout to specific local branch
4、click bottom Generate Pipeline Script button,you will get pipeline script.
Upvotes: 1
Reputation: 2636
check this one http://your-Jenkins:8080/pipeline-syntax/ , you can have samples of all your installed plugins.
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'your-sub-directory']], gitTool: 'Default', submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'd767bb7a-4c1e-4654-a310-996d4ece5b02', url: '[email protected]:yyy/xxx.git']]])
Upvotes: 5