Skip to content

Commit 05fcbc4

Browse files
committed
chore(ci/api): add /api/compose-multiplatform/ auto-deploy
1 parent af64ee2 commit 05fcbc4

File tree

1 file changed

+28
-9
lines changed

1 file changed

+28
-9
lines changed

.teamcity/common/ReferenceProject.kt

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import common.extensions.scriptNoRobots
55
import jetbrains.buildServer.configs.kotlin.BuildType
66
import jetbrains.buildServer.configs.kotlin.Project
77
import jetbrains.buildServer.configs.kotlin.RelativeId
8+
import jetbrains.buildServer.configs.kotlin.triggers.finishBuildTrigger
9+
import jetbrains.buildServer.configs.kotlin.triggers.vcs
810
import templates.SCRIPT_PATH
911
import templates.TemplateSearchIndex
1012
import vcsRoots.KotlinLangOrg
@@ -43,7 +45,7 @@ open class ReferenceProject(val urlPart: String, val projectTitle: String = urlP
4345
versions.add(buildReference() to version)
4446
}
4547

46-
fun pagesSearchType(workingDir: String) = BuildType {
48+
fun apiPagesType(workingDir: String) = BuildType {
4749
id = RelativeId("${projectPrefix}_Latest")
4850
name = "API Pages"
4951
description = "The latest stable version for $projectName"
@@ -91,20 +93,37 @@ open class ReferenceProject(val urlPart: String, val projectTitle: String = urlP
9193

9294
fun build() {
9395
val workingDir = "dist/api/$urlPart"
94-
val pages = pagesSearchType(workingDir)
96+
val pages = apiPagesType(workingDir)
9597

9698
project.apply {
9799
buildType(pages)
98100
buildType(searchBuildType(workingDir, pages))
99101
}
100102

101-
currentVersion.dependencies {
102-
for ((previousVersion, version) in versions) {
103-
if (previousVersion == currentVersion) continue
104-
artifacts(previousVersion) {
105-
buildRule = tag("release")
106-
artifactRules = "pages.zip!** => %OLD_VERSIONS_DIR%/$version/"
107-
cleanDestination = true
103+
pages.triggers {
104+
finishBuildTrigger {
105+
buildType = currentVersion.id.toString()
106+
branchFilter = "+:<default>"
107+
successfulOnly = true
108+
}
109+
}
110+
111+
currentVersion.apply {
112+
triggers {
113+
vcs {
114+
id = "trigger-vcs-default-trigger-id"
115+
branchFilter = "+:<default>"
116+
}
117+
}
118+
119+
dependencies {
120+
for ((previousVersion, version) in versions) {
121+
if (previousVersion == currentVersion) continue
122+
artifacts(previousVersion) {
123+
buildRule = tag("release")
124+
artifactRules = "pages.zip!** => %OLD_VERSIONS_DIR%/$version/"
125+
cleanDestination = true
126+
}
108127
}
109128
}
110129
}

0 commit comments

Comments
 (0)