mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
This commit is contained in:
parent
6b6593e8d5
commit
d38268e9ee
4 changed files with 90 additions and 1 deletions
8
.teamcity/src/Common.kt
vendored
8
.teamcity/src/Common.kt
vendored
|
@ -22,6 +22,14 @@ fun isReportingEnabled(): Boolean {
|
|||
return ENABLE_REPORTING;
|
||||
}
|
||||
|
||||
// master and 7.x get committed to so often, we only want to run full CI for them hourly
|
||||
// but for other branches, we can run daily and on merge
|
||||
fun isHourlyOnlyBranch(): Boolean {
|
||||
val branch = getProjectBranch()
|
||||
|
||||
return branch == "master" || branch.matches("""^[0-9]+\.x$""".toRegex())
|
||||
}
|
||||
|
||||
fun makeSafeId(id: String): String {
|
||||
return id.replace(Regex("[^a-zA-Z0-9_]"), "_")
|
||||
}
|
||||
|
|
37
.teamcity/src/builds/DailyCi.kt
vendored
Normal file
37
.teamcity/src/builds/DailyCi.kt
vendored
Normal file
|
@ -0,0 +1,37 @@
|
|||
package builds
|
||||
|
||||
import addSlackNotifications
|
||||
import areTriggersEnabled
|
||||
import dependsOn
|
||||
import getProjectBranch
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.BuildType
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.FailureAction
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.schedule
|
||||
|
||||
object DailyCi : BuildType({
|
||||
id("Daily_CI")
|
||||
name = "Daily CI"
|
||||
description = "Runs everything in CI, daily"
|
||||
type = Type.COMPOSITE
|
||||
paused = !areTriggersEnabled()
|
||||
|
||||
triggers {
|
||||
schedule {
|
||||
schedulingPolicy = cron {
|
||||
hours = "0"
|
||||
minutes = "0"
|
||||
}
|
||||
branchFilter = "refs/heads/${getProjectBranch()}"
|
||||
triggerBuild = always()
|
||||
withPendingChangesOnly = false
|
||||
}
|
||||
}
|
||||
|
||||
dependsOn(
|
||||
FullCi
|
||||
) {
|
||||
onDependencyCancel = FailureAction.ADD_PROBLEM
|
||||
}
|
||||
|
||||
addSlackNotifications()
|
||||
})
|
34
.teamcity/src/builds/OnMergeCi.kt
vendored
Normal file
34
.teamcity/src/builds/OnMergeCi.kt
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
package builds
|
||||
|
||||
import addSlackNotifications
|
||||
import areTriggersEnabled
|
||||
import dependsOn
|
||||
import getProjectBranch
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.BuildType
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.FailureAction
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.vcs
|
||||
|
||||
object OnMergeCi : BuildType({
|
||||
id("OnMerge_CI")
|
||||
name = "On Merge CI"
|
||||
description = "Runs everything in CI, on each commit"
|
||||
type = Type.COMPOSITE
|
||||
paused = !areTriggersEnabled()
|
||||
|
||||
maxRunningBuilds = 1
|
||||
|
||||
triggers {
|
||||
vcs {
|
||||
perCheckinTriggering = false
|
||||
branchFilter = "refs/heads/${getProjectBranch()}"
|
||||
}
|
||||
}
|
||||
|
||||
dependsOn(
|
||||
FullCi
|
||||
) {
|
||||
onDependencyCancel = FailureAction.ADD_PROBLEM
|
||||
}
|
||||
|
||||
addSlackNotifications()
|
||||
})
|
12
.teamcity/src/projects/Kibana.kt
vendored
12
.teamcity/src/projects/Kibana.kt
vendored
|
@ -7,6 +7,7 @@ import builds.oss.*
|
|||
import builds.test.*
|
||||
import CloudProfile
|
||||
import co.elastic.teamcity.common.googleCloudProfile
|
||||
import isHourlyOnlyBranch
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.*
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.projectFeatures.slackConnection
|
||||
import templates.KibanaTemplate
|
||||
|
@ -136,7 +137,16 @@ fun Kibana(config: KibanaConfiguration = KibanaConfiguration()) : Project {
|
|||
|
||||
buildType(FullCi)
|
||||
buildType(BaselineCi)
|
||||
buildType(HourlyCi)
|
||||
|
||||
// master and 7.x get committed to so often, we only want to run full CI for them hourly
|
||||
// but for other branches, we can run daily and on merge
|
||||
if (isHourlyOnlyBranch()) {
|
||||
buildType(HourlyCi)
|
||||
} else {
|
||||
buildType(DailyCi)
|
||||
buildType(OnMergeCi)
|
||||
}
|
||||
|
||||
buildType(PullRequestCi)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue