mirror of
https://github.com/Dannecron/netology-devops-teamcity-example.git
synced 2025-12-25 15:22:35 +03:00
78 lines
1.9 KiB
Kotlin
78 lines
1.9 KiB
Kotlin
import jetbrains.buildServer.configs.kotlin.*
|
|
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)
|
|
|
|
params {
|
|
text("top_level", "i'm here wewewewewe", readOnly = true, allowEmpty = true)
|
|
}
|
|
}
|
|
|
|
object Build : BuildType({
|
|
name = "Build"
|
|
|
|
artifactRules = "target/*.jar"
|
|
|
|
params {
|
|
text("env.another", "wewew", allowEmpty = false)
|
|
param("greeter", "hello")
|
|
}
|
|
|
|
vcs {
|
|
root(DslContext.settingsRoot)
|
|
}
|
|
|
|
steps {
|
|
maven {
|
|
name = "Test"
|
|
|
|
conditions {
|
|
doesNotContain("teamcity.build.branch", "master")
|
|
}
|
|
goals = "clean test"
|
|
userSettingsSelection = "settings.xml"
|
|
}
|
|
maven {
|
|
name = "Deploy"
|
|
|
|
conditions {
|
|
equals("teamcity.build.branch.is_default", "true")
|
|
}
|
|
goals = "clean deploy"
|
|
userSettingsSelection = "settings.xml"
|
|
}
|
|
}
|
|
|
|
triggers {
|
|
vcs {
|
|
}
|
|
}
|
|
})
|