Skip to content

Commit

Permalink
CI: Extract tip builds into a separate sub-project (#3578)
Browse files Browse the repository at this point in the history
* extract tip into a separate project

* exclude pull request from tip builds
  • Loading branch information
artspb authored Nov 22, 2023
1 parent 721a0d7 commit 60a9014
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions .teamcity/settings.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import jetbrains.buildServer.configs.kotlin.v2019_2.*
import jetbrains.buildServer.configs.kotlin.v2019_2.AbsoluteId
import jetbrains.buildServer.configs.kotlin.v2019_2.BuildType
import jetbrains.buildServer.configs.kotlin.v2019_2.DslContext
import jetbrains.buildServer.configs.kotlin.v2019_2.Project
import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.PullRequests
import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.commitStatusPublisher
import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.golang
Expand All @@ -8,7 +11,9 @@ import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.exec
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.powerShell
import jetbrains.buildServer.configs.kotlin.v2019_2.failureConditions.BuildFailureOnMetric
import jetbrains.buildServer.configs.kotlin.v2019_2.failureConditions.failOnMetricChange
import jetbrains.buildServer.configs.kotlin.v2019_2.project
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.vcs
import jetbrains.buildServer.configs.kotlin.v2019_2.version

/*
The settings script is an entry point for defining a TeamCity
Expand Down Expand Up @@ -66,9 +71,12 @@ project {
test.os
}.distinct().forEach { os ->
subProject(OSProject(os, tests.filter { test ->
test.os == os
test.os == os && test.version != "tip"
}))
}
subProject(TipProject(tests.filter { test ->
test.version == "tip"
}))
buildType(AggregatorBuild(tests))
params {
param("teamcity.ui.settings.readOnly", "true")
Expand Down Expand Up @@ -122,6 +130,15 @@ class AggregatorBuild(tests: Collection<BuildType>) : BuildType({
}
})

class TipProject(tests: List<TestBuild>) : Project({
id = AbsoluteId("Delve_tip")
name = "Tip"

tests.forEach { test ->
buildType(test)
}
})

class OSProject(os: String, tests: List<TestBuild>) : Project({
id = AbsoluteId("Delve_$os")
name = os.capitalize()
Expand All @@ -144,12 +161,13 @@ class ArchProject(os: String, arch: String, tests: List<TestBuild>) : Project({
}
})

class TestBuild(val os: String, val arch: String, version: String, buildId: AbsoluteId) : BuildType({
class TestBuild(val os: String, val arch: String, val version: String, buildId: AbsoluteId) : BuildType({
id = buildId
name = version
name = if (version == "tip") arch else version

vcs {
root(DslContext.settingsRoot)
branchFilter = if (version == "tip") "-:pull/*" else "+:*"
}

failureConditions {
Expand Down

0 comments on commit 60a9014

Please sign in to comment.