We have an automated build system configured using Jenkins开发者_高级运维, integrate with Gerrit. One of the bottlenecks today is that it takes ~3.5 minutes for Jenkins to complete a "git clone" for each build, due to repository size. The same check-out using "git archive" takes approx 12 seconds.
Can the gerrit plugin for Jenkins be configured to use "git archive"? This will significantly reduce our build time.
Although it doesn't appear to be possible using an unmodified version of the Git plugin, I did accomplish this in two steps:
1) Change SCM to "None" for the particular job.
2) Add a build step at the beginning to checkout using "git archive"
Here is a sample for step 2).
git archive --format=tar --remote=git://host/repo ${GERRIT_REFSPEC} > ${BUILD_ID}.tar && tar xvf ${BUILD_ID}.tar && rm ${BUILD_ID}.tar
精彩评论