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.BuildType
67import jetbrains.buildServer.configs.kotlin.DslContext
78import jetbrains.buildServer.configs.kotlin.Project
89import jetbrains.buildServer.configs.kotlin.buildFeatures.commitStatusPublisher
10+ import jetbrains.buildServer.configs.kotlin.buildFeatures.notifications
11+ import jetbrains.buildServer.configs.kotlin.buildSteps.gradle
12+ import jetbrains.buildServer.configs.kotlin.buildSteps.script
13+ import jetbrains.buildServer.configs.kotlin.toId
14+ import jetbrains.buildServer.configs.kotlin.triggers.schedule
15+ import jetbrains.buildServer.configs.kotlin.vcs.GitVcsRoot
916
1017fun Project.additionalConfiguration () {
1118 knownBuilds.buildAll.features {
@@ -19,4 +26,71 @@ fun Project.additionalConfiguration() {
1926 }
2027 }
2128 }
22- }
29+
30+ vcsRoot(EggertTzRepo )
31+
32+ BuildType {
33+ id(" Check_Updates" )
34+ name = " Check for timezone database updates"
35+ description = " Queries the Internet to see if the timezone data was updated"
36+
37+ vcs {
38+ root(DslContext .settingsRoot)
39+ root(EggertTzRepo , " +:. => tz" )
40+ }
41+
42+ steps {
43+ script {
44+ name = " Check if a new version of the timezone database is present"
45+ id = " Check_if_a_new_version_of_the_timezone_database_is_present"
46+ scriptContent = """
47+ set -efu
48+ latest_tag=$(git -C tz/ describe --abbrev=0 --tags)
49+ current_tag=$(grep tzdbVersion gradle.properties | cut -d= -f2)
50+ if [ "${' $' } latest_tag" != "${' $' } current_tag" ]; then
51+ printf "A new version of the timezone database is available: %s\n" "${' $' } latest_tag" >&2
52+ exit 1
53+ fi
54+ """ .trimIndent()
55+ }
56+ gradle {
57+ name = " Check if the Windows names need updating"
58+ id = " Check_if_the_Windows_names_need_updating"
59+ tasks = " downloadWindowsZonesMapping"
60+ jdkHome = " %env.JDK_18_x64%"
61+ }
62+ }
63+
64+ triggers {
65+ schedule {
66+ schedulingPolicy = daily {
67+ hour = 1
68+ minute = 50
69+ }
70+ triggerBuild = always()
71+ }
72+ }
73+
74+ features {
75+ notifications {
76+ notifierSettings = slackNotifier {
77+ connection = " PROJECT_EXT_51"
78+ sendTo = " #kotlin-lib-team"
79+ messageFormat = simpleMessageFormat()
80+ }
81+ buildFailed = true
82+ firstFailureAfterSuccess = true
83+ }
84+ }
85+
86+ requirements {
87+ doesNotContain(" teamcity.agent.jvm.os.name" , " Windows" )
88+ }
89+ }.also { buildType(it) }
90+ }
91+
92+ object EggertTzRepo : GitVcsRoot({
93+ name = " Timezone database repository"
94+ url = " https://github.com/eggert/tz"
95+ branch = " refs/heads/main"
96+ })
0 commit comments