Skip to content

Commit e26e66f

Browse files
author
Abduqodiri Qurbonzoda
committed
Forward build number from Build_Version to Benchmark
1 parent 5751379 commit e26e66f

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed

.teamcity/Benchmarks.kt

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ import jetbrains.buildServer.configs.kotlin.v2019_2.*
77
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.gradle
88
import java.lang.IllegalArgumentException
99

10-
fun benchmarksProject() = Project {
10+
fun benchmarksProject(buildVersion: BuildType) = Project {
1111
this.id("Benchmarks")
1212
this.name = "Benchmarks"
1313

1414
params {
1515
param("teamcity.ui.settings.readOnly", "true")
1616
}
1717

18-
val benchmarkAll = benchmarkAll()
18+
val benchmarkAll = benchmarkAll(buildVersion)
1919
val benchmarks = listOf(
20-
benchmark("js", Platform.Linux),
21-
benchmark("jvm", Platform.Linux),
22-
*platforms.map { benchmark("native", it) }.toTypedArray()
20+
benchmark("js", Platform.Linux, buildVersion),
21+
benchmark("jvm", Platform.Linux, buildVersion),
22+
*platforms.map { benchmark("native", it, buildVersion) }.toTypedArray()
2323
)
2424

2525
benchmarks.forEach { benchmark ->
@@ -34,21 +34,33 @@ fun benchmarksProject() = Project {
3434
buildTypesOrder = listOf(benchmarkAll, *benchmarks.toTypedArray())
3535
}
3636

37-
fun Project.benchmarkAll() = BuildType {
37+
fun Project.benchmarkAll(buildVersion: BuildType) = BuildType {
3838
id("Benchmark_All")
3939
this.name = "Benchmark (All)"
4040
type = BuildTypeSettings.Type.COMPOSITE
4141

42+
dependsOnSnapshot(buildVersion)
43+
buildNumberPattern = buildVersion.depParamRefs.buildNumber.ref
44+
4245
commonConfigure()
4346
}.also { buildType(it) }
4447

45-
fun Project.benchmark(target: String, platform: Platform) = buildType("${target}Benchmark", platform) {
48+
fun Project.benchmark(target: String, platform: Platform, buildVersion: BuildType) = buildType("${target}Benchmark", platform) {
49+
50+
dependsOnSnapshot(buildVersion)
51+
52+
params {
53+
param(versionSuffixParameter, buildVersion.depParamRefs[versionSuffixParameter].ref)
54+
param(teamcitySuffixParameter, buildVersion.depParamRefs[teamcitySuffixParameter].ref)
55+
}
56+
4657
steps {
4758
gradle {
4859
name = "Benchmark"
4960
tasks = benchmarkTask(target, platform)
5061
jdkHome = "%env.$jdk%"
5162
param("org.jfrog.artifactory.selectedDeployableServer.defaultModuleVersionConfiguration", "GLOBAL")
63+
gradleParams = "--info --stacktrace -P$versionSuffixParameter=%$versionSuffixParameter% -P$teamcitySuffixParameter=%$teamcitySuffixParameter%"
5264
buildFile = ""
5365
gradleWrapperPath = ""
5466
}

.teamcity/additionalConfiguration.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
* Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file.
44
*/
55

6+
import jetbrains.buildServer.configs.kotlin.v2019_2.BuildType
67
import jetbrains.buildServer.configs.kotlin.v2019_2.Project
78

8-
fun Project.additionalConfiguration() {
9-
subProject(benchmarksProject())
9+
fun Project.additionalConfiguration(buildVersion: BuildType) {
10+
subProject(benchmarksProject(buildVersion))
1011
}

.teamcity/settings.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ project {
5858

5959
buildTypesOrder = listOf(buildAll, buildVersion, *builds.toTypedArray(), deployPublish, deployConfigure, *deploys.toTypedArray())
6060

61-
additionalConfiguration()
61+
additionalConfiguration(buildVersion)
6262
}
6363

6464
fun Project.buildVersion() = BuildType {

0 commit comments

Comments
 (0)