I am using Jenkins file to build a pipeline. I am trying to clone the reference repository using DSL like below.
checkout(
[$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false,
extensions: [[$class: 'CloneOption', depth: 1, noTags: false, reference: '', shallow: true]],
submoduleCfg: [],
userRemoteConfigs: [[url: 'git@bitbucket.org:user_team/infrastructure-as-code.git']])
and while the pipeline is being executed, it is being translated to this
git fetch --tags --progress git@bitbucket.org:userteam/infrastructure-as-code.git +refs/heads/*:refs/remotes/origin/* --depth=1
This clones the whole repository on my Jenkins server. I just want to obtain a shallow copy of my repo so that I could save my Jenkins server from space crunch. Please help here.
I am using: Jenkins version: 2.58,
Plugins:
Pipeline SCM Step: 2.4
Git: 3.3.0