From 9c03e2b5ded1c8939e349f2313d9276b2d6a9d9c Mon Sep 17 00:00:00 2001 From: nd Date: Wed, 20 Jan 2021 14:02:58 +0100 Subject: [PATCH] Fixing branch selection in TeamCity builds (#2311) * Enable pull-requests in all builds Otherwise test builds always use the master branch * Apply change in settings made in UI --- .../patches/buildTypes/AggregatorBuild.kts | 37 ------------------- .teamcity/settings.kts | 27 ++++++++------ 2 files changed, 16 insertions(+), 48 deletions(-) delete mode 100644 .teamcity/patches/buildTypes/AggregatorBuild.kts diff --git a/.teamcity/patches/buildTypes/AggregatorBuild.kts b/.teamcity/patches/buildTypes/AggregatorBuild.kts deleted file mode 100644 index f5c68cec..00000000 --- a/.teamcity/patches/buildTypes/AggregatorBuild.kts +++ /dev/null @@ -1,37 +0,0 @@ -package patches.buildTypes - -import jetbrains.buildServer.configs.kotlin.v2019_2.* -import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.CommitStatusPublisher -import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.commitStatusPublisher -import jetbrains.buildServer.configs.kotlin.v2019_2.ui.* - -/* -This patch script was generated by TeamCity on settings change in UI. -To apply the patch, change the buildType with id = 'AggregatorBuild' -accordingly, and delete the patch script. -*/ -changeBuildType(RelativeId("AggregatorBuild")) { - features { - val feature1 = find { - commitStatusPublisher { - vcsRootExtId = "${DslContext.settingsRoot.id}" - publisher = github { - githubUrl = "https://api.github.com" - authType = personalToken { - token = "credentialsJSON:5dc93081-e0b2-41e2-b8f0-dea3c96e6426" - } - } - param("github_oauth_user", "derekparker") - } - } - feature1.apply { - publisher = github { - githubUrl = "https://api.github.com" - authType = personalToken { - token = "credentialsJSON:48af6e38-536d-4acb-ae2d-2fba57b6f3db" - } - } - param("github_oauth_user", "") - } - } -} diff --git a/.teamcity/settings.kts b/.teamcity/settings.kts index a441a6f0..e10c7d6a 100644 --- a/.teamcity/settings.kts +++ b/.teamcity/settings.kts @@ -81,24 +81,16 @@ class AggregatorBuild(tests: Collection) : BuildType({ } features { - pullRequests { - vcsRootExtId = "${DslContext.settingsRoot.id}" - provider = github { - authType = token { - token = "credentialsJSON:5dc93081-e0b2-41e2-b8f0-dea3c96e6426" - } - filterAuthorRole = PullRequests.GitHubRoleFilter.EVERYBODY - } - } + enablePullRequests() commitStatusPublisher { vcsRootExtId = "${DslContext.settingsRoot.id}" publisher = github { githubUrl = "https://api.github.com" authType = personalToken { - token = "credentialsJSON:5dc93081-e0b2-41e2-b8f0-dea3c96e6426" + token = "credentialsJSON:48af6e38-536d-4acb-ae2d-2fba57b6f3db" } } - param("github_oauth_user", "derekparker") + param("github_oauth_user", "") } } }) @@ -194,8 +186,21 @@ class TestBuild(val os: String, val arch: String, version: String, buildId: Abso } features { + enablePullRequests() golang { testFormat = "json" } } }) + +fun enablePullRequests() { + pullRequests { + vcsRootExtId = "${DslContext.settingsRoot.id}" + provider = github { + authType = token { + token = "credentialsJSON:5dc93081-e0b2-41e2-b8f0-dea3c96e6426" + } + filterAuthorRole = PullRequests.GitHubRoleFilter.EVERYBODY + } + } +} \ No newline at end of file