@@ -5,6 +5,8 @@ import common.extensions.scriptNoRobots
5
5
import jetbrains.buildServer.configs.kotlin.BuildType
6
6
import jetbrains.buildServer.configs.kotlin.Project
7
7
import jetbrains.buildServer.configs.kotlin.RelativeId
8
+ import jetbrains.buildServer.configs.kotlin.triggers.finishBuildTrigger
9
+ import jetbrains.buildServer.configs.kotlin.triggers.vcs
8
10
import templates.SCRIPT_PATH
9
11
import templates.TemplateSearchIndex
10
12
import vcsRoots.KotlinLangOrg
@@ -43,7 +45,7 @@ open class ReferenceProject(val urlPart: String, val projectTitle: String = urlP
43
45
versions.add(buildReference() to version)
44
46
}
45
47
46
- fun pagesSearchType (workingDir : String ) = BuildType {
48
+ fun apiPagesType (workingDir : String ) = BuildType {
47
49
id = RelativeId (" ${projectPrefix} _Latest" )
48
50
name = " API Pages"
49
51
description = " The latest stable version for $projectName "
@@ -91,20 +93,37 @@ open class ReferenceProject(val urlPart: String, val projectTitle: String = urlP
91
93
92
94
fun build () {
93
95
val workingDir = " dist/api/$urlPart "
94
- val pages = pagesSearchType (workingDir)
96
+ val pages = apiPagesType (workingDir)
95
97
96
98
project.apply {
97
99
buildType(pages)
98
100
buildType(searchBuildType(workingDir, pages))
99
101
}
100
102
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
+ }
108
127
}
109
128
}
110
129
}
0 commit comments