Setting teamcity.git.fetchAllHeads to true

Our build needs access to the master branch in order to compute which commits  are on the branch to it can run analysis on the commit messages.

I can set teamcity.git.fetchAllHeads to true in the params for a custom build, but I can't figure out how to set it using the teamcity.default.properties file.

When I do add the setting to teamcity.default.properties, I get this message in the build:  Unexpected property 'teamcity.git.fetchAllHeads' in ******* default properties file: /opt/buildAgent/work/baa2cc8a8e415810/teamcity.default.properties

We are using TeamCity server version is 2018.1.2 (build 58537)

 

 We are using VCS setting for our build, BTW.  We have some kotlin settings, but I wasn't able to find any examples of Kotlin configuring the GitVcsRoot class.   I also couldn't find the fetchAllHeads on the GitVcsRoot class. 

Is there any way to fetch origin/master as well as the PR branch? We don't need all heads, just the PR and master.  Thanks in advance.

 

2
2 comments
Avatar
Permanently deleted user

I was able to use this:

params {

        param("teamcity.git.fetchAllHeads", "true")

    }

However, it's downloading ALL branches, which can be slow.  Is there a way just to get the PR and origin/master?

Thanks

1

Not directly. The easiest way to perform this task if you want to download multiple branches is to download them by yourself as a first step on the build script.

 

We have just released a plugin to natively support pull requests from github, you might be interested in checking it out: https://blog.jetbrains.com/teamcity/2018/10/github-pull-requests-plugin-for-teamcity/

 

Also, regarding your other question, internal properties don't have a direct parameter in the DSL, they still need to be added as parameters, as you have experienced.

0

Please sign in to leave a comment.