简体   繁体   中英

Git Jenkins - how to skip git fetch tags in script pipeline declarative?

I have a problem in my pipelines on Jenkins, when my code is cloned from Bitbucket, it takes a lot of time performing this line:

git fetch --tags --progress git@bitbucket.org:team/empresas.git +refs/heads/ :refs/remotes/origin/

My pipeline execute this stage:

stage('checkout git') {
    steps {
        git branch: branch, credentialsId: 'develop214', url: scmUrl
    }
}

Jenkins when perform my stage execute all this tasks:

 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url git@bitbucket.org:fisateam/empresas.git # timeout=10
Fetching upstream changes from git@bitbucket.org:team/empresas.git
 > git --version # timeout=10
 > git fetch --tags --progress git@bitbucket.org:team/empresas.git +refs/heads/*:refs/remotes/origin/*
 > git rev-parse refs/remotes/origin/develop^{commit} # timeout=10
 > git rev-parse refs/remotes/origin/origin/develop^{commit} # timeout=10
Checking out Revision f87a5d7586308093e4ab22fbace8c9f817316c29 (refs/remotes/origin/develop)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f f87a5d7586308093e4ab22fbace8c9f817316c29
 > git branch -a -v --no-abbrev # timeout=10
 > git branch -D develop # timeout=10
 > git checkout -b develop f87a5d7586308093e4ab22fbace8c9f817316c29
Commit message: "Merge remote-tracking branch 'origin/develop' into develop"
 > git rev-list --no-walk f87a5d7586308093e4ab22fbace8c9f817316c29 # timeout=10

There is any configuration to avoid the execution of "git fetch --tags" programaticaly in pipeline script?

最后,我们发现了Jenkins执行管道极慢的问题,这是因为我们对防火墙做了一些改动而触发的,它引发了到bitbucket的连接只会在服务器段太慢。

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM