SparseCheckout in Jenkinsfile pipeline

前端 未结 3 1546
猫巷女王i
猫巷女王i 2020-12-09 20:34

In a jenkinsfile, I have specified the folderName through SparseCheckoutPaths which I want to checkout. But I am getting a whole branch checkout instead.

3条回答
  •  [愿得一人]
    2020-12-09 21:26

    Your syntax looks good, but, as seen in "jenkinsci/plugins/gitclient/CliGitAPIImpl.java", did you specify the right configuration?

    private void sparseCheckout(@NonNull List paths) throws GitException, InterruptedException {
    
        boolean coreSparseCheckoutConfigEnable;
        try {
            coreSparseCheckoutConfigEnable = launchCommand("config", "core.sparsecheckout").contains("true");
        } catch (GitException ge) {
            coreSparseCheckoutConfigEnable = false;
        }
    

    In other words, is git config core.sparsecheckout equal to true in the repo you are about to checkout?

提交回复
热议问题