Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins pipeline: How to checkout repository without triggering polling or tracking changes?

My project consists of multiple git repositories. One main repository, and other helper repositories. In jenkins pipeline, I want to checkout scm: all of them, but I am only interested in tracking changes, and polling from the main repository - others clutter the changelog and cause other infrastructure problems (it's a big project).

I thought about simply checking out remaining repositories in sh blocks to skip "features" I don't want, but I'll have to duplicate config, and somehow pass credentials - generally I'd like pipelines to do the work for me.

Expected result: checkout scm does not cause changelog to appear, or cause polling from said repo down the line.

Is there a way to archive this using configuration, instead of hiding checkout logic from pipeline using shstep?

like image 650
charlie_pl Avatar asked Oct 27 '22 16:10

charlie_pl


1 Answers

Use the following code in Jenkinsfile:

checkout scm: scm, poll: false, changelog: false
like image 100
Chao Cai Avatar answered Oct 31 '22 08:10

Chao Cai