From bf82931dcede384701b91c8e3ae45667a4044078 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 12 Oct 2021 18:16:47 +0000 Subject: [PATCH] TeamCity change in 'example_command' project: Synchronization with own VCS root is enabled --- .../pluginData/_Self/mavenSettings/custom | 261 ++++++++++++++++++ .../ExampleCommand_BuildDeploy.xml | 39 +++ .teamcity/pom.xml | 104 +++++++ .teamcity/settings.kts | 117 ++++++++ 4 files changed, 521 insertions(+) create mode 100644 .teamcity/pluginData/_Self/mavenSettings/custom create mode 100644 .teamcity/pluginData/_Self/metaRunners/ExampleCommand_BuildDeploy.xml create mode 100644 .teamcity/pom.xml create mode 100644 .teamcity/settings.kts diff --git a/.teamcity/pluginData/_Self/mavenSettings/custom b/.teamcity/pluginData/_Self/mavenSettings/custom new file mode 100644 index 0000000..a19c081 --- /dev/null +++ b/.teamcity/pluginData/_Self/mavenSettings/custom @@ -0,0 +1,261 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + nexus + admin + admin123 + + + + + + + + + + + + + + + + + + diff --git a/.teamcity/pluginData/_Self/metaRunners/ExampleCommand_BuildDeploy.xml b/.teamcity/pluginData/_Self/metaRunners/ExampleCommand_BuildDeploy.xml new file mode 100644 index 0000000..7b6d21c --- /dev/null +++ b/.teamcity/pluginData/_Self/metaRunners/ExampleCommand_BuildDeploy.xml @@ -0,0 +1,39 @@ + + sdgfhj + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.teamcity/pom.xml b/.teamcity/pom.xml new file mode 100644 index 0000000..98bc5fe --- /dev/null +++ b/.teamcity/pom.xml @@ -0,0 +1,104 @@ + + + 4.0.0 + ExampleCommand Config DSL Script + ExampleCommand + ExampleCommand_dsl + 1.0-SNAPSHOT + + + org.jetbrains.teamcity + configs-dsl-kotlin-parent + 1.0-SNAPSHOT + + + + + jetbrains-all + https://download.jetbrains.com/teamcity-repository + + true + + + + teamcity-server + http://178.154.210.239:8111/app/dsl-plugins-repository + + true + + + + + + + JetBrains + https://download.jetbrains.com/teamcity-repository + + + + + ${basedir} + + + kotlin-maven-plugin + org.jetbrains.kotlin + ${kotlin.version} + + + + + compile + process-sources + + compile + + + + test-compile + process-test-sources + + test-compile + + + + + + org.jetbrains.teamcity + teamcity-configs-maven-plugin + ${teamcity.dsl.version} + + kotlin + target/generated-configs + + + + + + + + org.jetbrains.teamcity + configs-dsl-kotlin + ${teamcity.dsl.version} + compile + + + org.jetbrains.teamcity + configs-dsl-kotlin-plugins + 1.0-SNAPSHOT + pom + compile + + + org.jetbrains.kotlin + kotlin-stdlib-jdk8 + ${kotlin.version} + compile + + + org.jetbrains.kotlin + kotlin-script-runtime + ${kotlin.version} + compile + + + \ No newline at end of file diff --git a/.teamcity/settings.kts b/.teamcity/settings.kts new file mode 100644 index 0000000..5dda7d8 --- /dev/null +++ b/.teamcity/settings.kts @@ -0,0 +1,117 @@ +import jetbrains.buildServer.configs.kotlin.v2019_2.* +import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.maven +import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.script +import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.vcs +import jetbrains.buildServer.configs.kotlin.v2019_2.vcs.GitVcsRoot + +/* +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 = "2021.1" + +project { + + vcsRoot(HttpsGithubComAragastmatbExampleTeamcityGit) + + buildType(BuildDeploy) + buildType(First) + buildType(RtdyjfuioliohklOp) + + params { + password("env.custom_prop", "credentialsJSON:fd18682a-8e79-46f4-a9f1-51401dfe87df", readOnly = true) + } +} + +object BuildDeploy : BuildType({ + name = "Build&Deploy" + + artifactRules = "+:target/*.jar" + publishArtifacts = PublishMode.SUCCESSFUL + + vcs { + root(DslContext.settingsRoot) + } + + steps { + maven { + name = "Make Some Test" + + conditions { + doesNotContain("teamcity.build.branch", "master") + } + goals = "clean test" + runnerArgs = "-Dmaven.test.failure.ignore=true" + userSettingsSelection = "custom" + } + maven { + name = "Deploy to Nexus" + + conditions { + contains("teamcity.build.branch", "master") + } + goals = "clean deploy" + runnerArgs = "-Dmaven.test.failure.ignore=true" + userSettingsSelection = "custom" + } + } + + triggers { + vcs { + } + } +}) + +object First : BuildType({ + name = "first" + + params { + param("custom_chekout_dir", "123") + } + + vcs { + root(HttpsGithubComAragastmatbExampleTeamcityGit) + + checkoutDir = "%custom_chekout_dir%" + } + + steps { + script { + name = "echo variables" + scriptContent = """ + echo 1 + echo %custom_chekout_dir% + export custom_prop=new + echo ${'$'}custom_prop + """.trimIndent() + } + } +}) + +object RtdyjfuioliohklOp : BuildType({ + name = "rtdyjfuioliohkl;op" +}) + +object HttpsGithubComAragastmatbExampleTeamcityGit : GitVcsRoot({ + name = "https://github.com/aragastmatb/example-teamcity.git" + url = "https://github.com/aragastmatb/example-teamcity.git" + branch = "refs/heads/master" +})