Ở bài 2 chúng ta đã có file kotlin DSL trên repo:
https://nimtechnology.com/2022/08/04/teamcity-kotlin-dsl-lesson-2-dsl-basics/
Vậy ở bài này mình tìm 1 cách đơn giản để gen code kotlin







sau đó bạn save và push lên github nhé



Giờ chúng ta đi khám phá status build có j mới mẻ




anh em cũng có thể chỉnh bất cứ thứ j trên UI và sem lại code






tiếp tục xem code

Bạn có thể save đại và view ở layer ngoài sẽ dễ hơn!

đưới dây là toàn bộ file kotlin
import jetbrains.buildServer.configs.kotlin.* import jetbrains.buildServer.configs.kotlin.buildFeatures.freeDiskSpace import jetbrains.buildServer.configs.kotlin.buildSteps.maven import jetbrains.buildServer.configs.kotlin.triggers.vcs /* The settings script is an entry point for defining a TeamCity project hierarchy. The script should contain a single call to the project() function with a Project instance or an init function as an argument. VcsRoots, BuildTypes, Templates, and subprojects can be registered inside the project using the vcsRoot(), buildType(), template(), and subProject() methods respectively. To debug settings scripts in command-line, run the mvnDebug org.jetbrains.teamcity:teamcity-configs-maven-plugin:generate command and attach your debugger to the port 8000. To debug in IntelliJ Idea, open the 'Maven Projects' tool window (View -> Tool Windows -> Maven Projects), find the generate task node (Plugins -> teamcity-configs -> teamcity-configs:generate), the 'Debug' option is available in the context menu for the task. */ version = "2022.04" project { buildType(Build) } object Build : BuildType({ name = "Build" vcs { root(DslContext.settingsRoot) } steps { maven { name = "Nim custom step name" goals = "clean test" runnerArgs = "-Dmaven.test.failure.ignore=true" } } features { freeDiskSpace { requiredSpace = "1gb" failBuild = true } } triggers { vcs { branchFilter = """ +:lesson1 +:lesson2 +:main """.trimIndent() } } features { freeDiskSpace { requiredSpace = "1gb" failBuild = true } } })