From a0dc8e383bbb7c6b5501473dd2f5d6cbc5eba98b Mon Sep 17 00:00:00 2001 From: Alexey Metlyakov Date: Wed, 21 Jul 2021 21:40:41 +0300 Subject: [PATCH 01/10] some add --- src/main/java/plaindoll/Welcomer.java | 3 +++ src/test/java/plaindoll/WelcomerTest.java | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/main/java/plaindoll/Welcomer.java b/src/main/java/plaindoll/Welcomer.java index 940a52a..eea643e 100644 --- a/src/main/java/plaindoll/Welcomer.java +++ b/src/main/java/plaindoll/Welcomer.java @@ -7,4 +7,7 @@ public class Welcomer{ public String sayFarewell() { return "Farewell, good hunter. May you find your worth in waking world."; } + public String saySome(){ + return "Some"; + } } diff --git a/src/test/java/plaindoll/WelcomerTest.java b/src/test/java/plaindoll/WelcomerTest.java index 12c401e..34b383d 100644 --- a/src/test/java/plaindoll/WelcomerTest.java +++ b/src/test/java/plaindoll/WelcomerTest.java @@ -22,5 +22,9 @@ public class WelcomerTest { assertThat(welcomer.sayWelcome(), containsString("hunter")); assertThat(welcomer.sayFarewell(), containsString("hunter")); } + @Test + public void welcomerSaysSome(){ + assertThat(welcomer.saySome(), containsString("Another")); + } } \ No newline at end of file From 14164a40020b82a1efe130d5949f376fd964f656 Mon Sep 17 00:00:00 2001 From: Alexey Metlyakov Date: Wed, 21 Jul 2021 21:44:14 +0300 Subject: [PATCH 02/10] fix some --- src/test/java/plaindoll/WelcomerTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/plaindoll/WelcomerTest.java b/src/test/java/plaindoll/WelcomerTest.java index 34b383d..8e87129 100644 --- a/src/test/java/plaindoll/WelcomerTest.java +++ b/src/test/java/plaindoll/WelcomerTest.java @@ -24,7 +24,7 @@ public class WelcomerTest { } @Test public void welcomerSaysSome(){ - assertThat(welcomer.saySome(), containsString("Another")); + assertThat(welcomer.saySome(), containsString("Some")); } } \ No newline at end of file From da21a28caf72bfede928165dd537cf1740abb61d Mon Sep 17 00:00:00 2001 From: Alexey Metlyakov Date: Wed, 21 Jul 2021 22:26:11 +0300 Subject: [PATCH 03/10] add confbuild --- .teamcity/README | 7 + .../_Self/metaRunners/Example_Build.xml | 40 +++++ .teamcity/pom.xml | 104 +++++++++++ .teamcity/settings.kts | 168 ++++++++++++++++++ 4 files changed, 319 insertions(+) create mode 100644 .teamcity/README create mode 100644 .teamcity/pluginData/_Self/metaRunners/Example_Build.xml create mode 100644 .teamcity/pom.xml create mode 100644 .teamcity/settings.kts diff --git a/.teamcity/README b/.teamcity/README new file mode 100644 index 0000000..056eb30 --- /dev/null +++ b/.teamcity/README @@ -0,0 +1,7 @@ +The archive contains settings for a TeamCity project. + +To edit the settings in IntelliJ Idea, open the pom.xml and +select the 'Open as a project' option. + +If you want to move this dsl to version control, save it in the +.teamcity directory. \ No newline at end of file diff --git a/.teamcity/pluginData/_Self/metaRunners/Example_Build.xml b/.teamcity/pluginData/_Self/metaRunners/Example_Build.xml new file mode 100644 index 0000000..92946b8 --- /dev/null +++ b/.teamcity/pluginData/_Self/metaRunners/Example_Build.xml @@ -0,0 +1,40 @@ + + 554645 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.teamcity/pom.xml b/.teamcity/pom.xml new file mode 100644 index 0000000..ebcdecf --- /dev/null +++ b/.teamcity/pom.xml @@ -0,0 +1,104 @@ + + + 4.0.0 + Example Config DSL Script + Example + Example_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://localhost: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..59d1945 --- /dev/null +++ b/.teamcity/settings.kts @@ -0,0 +1,168 @@ +import jetbrains.buildServer.configs.kotlin.v2019_2.* +import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.maven +import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.python +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 = "2020.2" + +project { + + vcsRoot(HttpsGithubComAragastmatbExampleTeamcityGitRefsHeadsMaster) + + buildType(Build) + buildType(MyNewBuild) + + template(id123) + + params { + text("name", "", allowEmpty = false) + text("env.name", "%name%", display = ParameterDisplay.HIDDEN, allowEmpty = false) + } +} + +object Build : BuildType({ + name = "Build" + + artifactRules = "target/*.jar => target" + publishArtifacts = PublishMode.SUCCESSFUL + + vcs { + root(HttpsGithubComAragastmatbExampleTeamcityGitRefsHeadsMaster) + } + + steps { + maven { + name = "Package" + executionMode = BuildStep.ExecutionMode.RUN_ON_FAILURE + + conditions { + contains("teamcity.build.branch", "master") + } + goals = "package" + runnerArgs = "-Dmaven.test.failure.ignore=true" + } + maven { + name = "Build & Test" + executionMode = BuildStep.ExecutionMode.RUN_ON_FAILURE + + conditions { + doesNotContain("teamcity.build.branch", "master") + } + goals = "clean test" + runnerArgs = "-Dmaven.test.failure.ignore=true" + } + } + + triggers { + vcs { + } + } +}) + +object MyNewBuild : BuildType({ + name = "My New Build" + + params { + text("env.some", "one", display = ParameterDisplay.HIDDEN, readOnly = true, allowEmpty = true) + } + + steps { + python { + name = "Get version" + command = custom { + arguments = "-V" + } + } + script { + name = "Get Environment" + scriptContent = """ + echo ${'$'}name + echo ${'$'}some + """.trimIndent() + } + } + + requirements { + equals("teamcity.agent.jvm.os.name", "MAcos", "RQ_1") + } + + disableSettings("RQ_1") +}) + +object id123 : Template({ + id("123") + name = "123" + + artifactRules = "target/*.jar => target" + publishArtifacts = PublishMode.SUCCESSFUL + + vcs { + root(HttpsGithubComAragastmatbExampleTeamcityGitRefsHeadsMaster) + } + + steps { + maven { + name = "Package" + id = "RUNNER_3" + executionMode = BuildStep.ExecutionMode.RUN_ON_FAILURE + + conditions { + contains("teamcity.build.branch", "master") + } + goals = "package" + runnerArgs = "-Dmaven.test.failure.ignore=true" + } + maven { + name = "Build & Test" + id = "RUNNER_4" + executionMode = BuildStep.ExecutionMode.RUN_ON_FAILURE + + conditions { + doesNotContain("teamcity.build.branch", "master") + } + goals = "clean test" + runnerArgs = "-Dmaven.test.failure.ignore=true" + } + } + + triggers { + vcs { + id = "vcsTrigger" + } + } +}) + +object HttpsGithubComAragastmatbExampleTeamcityGitRefsHeadsMaster : GitVcsRoot({ + name = "https://github.com/aragastmatb/example-teamcity.git#refs/heads/master" + url = "https://github.com/aragastmatb/example-teamcity.git" + branch = "refs/heads/master" + branchSpec = "refs/heads/*" + authMethod = password { + userName = "aragastmatb" + password = "credentialsJSON:324ac48d-364a-448d-9ba5-b42efb076fe6" + } +}) From 06ac313c71518f446abf7d8e397204134e8e3ec7 Mon Sep 17 00:00:00 2001 From: Alexey Metlyakov Date: Wed, 21 Jul 2021 22:28:26 +0300 Subject: [PATCH 04/10] xzfdvs --- .teamcity/settings.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.teamcity/settings.kts b/.teamcity/settings.kts index 59d1945..28a9a14 100644 --- a/.teamcity/settings.kts +++ b/.teamcity/settings.kts @@ -60,7 +60,7 @@ object Build : BuildType({ executionMode = BuildStep.ExecutionMode.RUN_ON_FAILURE conditions { - contains("teamcity.build.branch", "master") + contains("teamcity.build.branch", "mter") } goals = "package" runnerArgs = "-Dmaven.test.failure.ignore=true" From 473432dc4ee914d23c53726c8c304d0b186b8b33 Mon Sep 17 00:00:00 2001 From: Alexey Metlyakov Date: Tue, 12 Oct 2021 13:09:39 +0300 Subject: [PATCH 05/10] add deploy phase --- pom.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pom.xml b/pom.xml index cbd5b24..f42352a 100644 --- a/pom.xml +++ b/pom.xml @@ -44,6 +44,20 @@ + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.5.1 + + + default-deploy + deploy + + deploy + + + + From 5fc3423c473dacf926a53dbd780b1d625038556f Mon Sep 17 00:00:00 2001 From: Alexey Metlyakov Date: Tue, 12 Oct 2021 13:24:31 +0300 Subject: [PATCH 06/10] add repository --- pom.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f42352a..c041217 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,12 @@ 1.8 1.8 - + + + nexus + http://178.154.233.99:8081/repository/maven-releases + + junit From 1bdb8c12e2ac66a307907e5759a41a12362e10e1 Mon Sep 17 00:00:00 2001 From: Alexey Metlyakov Date: Tue, 12 Oct 2021 13:26:45 +0300 Subject: [PATCH 07/10] fix repos --- .gitignore | 1 + pom.xml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1de5659 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +target \ No newline at end of file diff --git a/pom.xml b/pom.xml index c041217..84ccb79 100644 --- a/pom.xml +++ b/pom.xml @@ -13,10 +13,10 @@ 1.8 - + nexus http://178.154.233.99:8081/repository/maven-releases - + From 7f2a78b7939aa94bce8e493f2aa688f9a065a652 Mon Sep 17 00:00:00 2001 From: Alexey Metlyakov Date: Tue, 12 Oct 2021 13:30:26 +0300 Subject: [PATCH 08/10] try for tc --- pom.xml | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/pom.xml b/pom.xml index 84ccb79..f9255d5 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.netology plaindoll jar - 0.2.0 + 0.2.5 1.8 @@ -49,20 +49,6 @@ - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.5.1 - - - default-deploy - deploy - - deploy - - - - From 59f32315c548c4bb2765e0052c9717a53e40387a Mon Sep 17 00:00:00 2001 From: Alexey Metlyakov Date: Tue, 12 Oct 2021 13:37:21 +0300 Subject: [PATCH 09/10] remove tc cong --- .teamcity/README | 7 - .../_Self/metaRunners/Example_Build.xml | 40 ----- .teamcity/pom.xml | 104 ----------- .teamcity/settings.kts | 168 ------------------ 4 files changed, 319 deletions(-) delete mode 100644 .teamcity/README delete mode 100644 .teamcity/pluginData/_Self/metaRunners/Example_Build.xml delete mode 100644 .teamcity/pom.xml delete mode 100644 .teamcity/settings.kts diff --git a/.teamcity/README b/.teamcity/README deleted file mode 100644 index 056eb30..0000000 --- a/.teamcity/README +++ /dev/null @@ -1,7 +0,0 @@ -The archive contains settings for a TeamCity project. - -To edit the settings in IntelliJ Idea, open the pom.xml and -select the 'Open as a project' option. - -If you want to move this dsl to version control, save it in the -.teamcity directory. \ No newline at end of file diff --git a/.teamcity/pluginData/_Self/metaRunners/Example_Build.xml b/.teamcity/pluginData/_Self/metaRunners/Example_Build.xml deleted file mode 100644 index 92946b8..0000000 --- a/.teamcity/pluginData/_Self/metaRunners/Example_Build.xml +++ /dev/null @@ -1,40 +0,0 @@ - - 554645 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.teamcity/pom.xml b/.teamcity/pom.xml deleted file mode 100644 index ebcdecf..0000000 --- a/.teamcity/pom.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - 4.0.0 - Example Config DSL Script - Example - Example_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://localhost: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 deleted file mode 100644 index 28a9a14..0000000 --- a/.teamcity/settings.kts +++ /dev/null @@ -1,168 +0,0 @@ -import jetbrains.buildServer.configs.kotlin.v2019_2.* -import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.maven -import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.python -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 = "2020.2" - -project { - - vcsRoot(HttpsGithubComAragastmatbExampleTeamcityGitRefsHeadsMaster) - - buildType(Build) - buildType(MyNewBuild) - - template(id123) - - params { - text("name", "", allowEmpty = false) - text("env.name", "%name%", display = ParameterDisplay.HIDDEN, allowEmpty = false) - } -} - -object Build : BuildType({ - name = "Build" - - artifactRules = "target/*.jar => target" - publishArtifacts = PublishMode.SUCCESSFUL - - vcs { - root(HttpsGithubComAragastmatbExampleTeamcityGitRefsHeadsMaster) - } - - steps { - maven { - name = "Package" - executionMode = BuildStep.ExecutionMode.RUN_ON_FAILURE - - conditions { - contains("teamcity.build.branch", "mter") - } - goals = "package" - runnerArgs = "-Dmaven.test.failure.ignore=true" - } - maven { - name = "Build & Test" - executionMode = BuildStep.ExecutionMode.RUN_ON_FAILURE - - conditions { - doesNotContain("teamcity.build.branch", "master") - } - goals = "clean test" - runnerArgs = "-Dmaven.test.failure.ignore=true" - } - } - - triggers { - vcs { - } - } -}) - -object MyNewBuild : BuildType({ - name = "My New Build" - - params { - text("env.some", "one", display = ParameterDisplay.HIDDEN, readOnly = true, allowEmpty = true) - } - - steps { - python { - name = "Get version" - command = custom { - arguments = "-V" - } - } - script { - name = "Get Environment" - scriptContent = """ - echo ${'$'}name - echo ${'$'}some - """.trimIndent() - } - } - - requirements { - equals("teamcity.agent.jvm.os.name", "MAcos", "RQ_1") - } - - disableSettings("RQ_1") -}) - -object id123 : Template({ - id("123") - name = "123" - - artifactRules = "target/*.jar => target" - publishArtifacts = PublishMode.SUCCESSFUL - - vcs { - root(HttpsGithubComAragastmatbExampleTeamcityGitRefsHeadsMaster) - } - - steps { - maven { - name = "Package" - id = "RUNNER_3" - executionMode = BuildStep.ExecutionMode.RUN_ON_FAILURE - - conditions { - contains("teamcity.build.branch", "master") - } - goals = "package" - runnerArgs = "-Dmaven.test.failure.ignore=true" - } - maven { - name = "Build & Test" - id = "RUNNER_4" - executionMode = BuildStep.ExecutionMode.RUN_ON_FAILURE - - conditions { - doesNotContain("teamcity.build.branch", "master") - } - goals = "clean test" - runnerArgs = "-Dmaven.test.failure.ignore=true" - } - } - - triggers { - vcs { - id = "vcsTrigger" - } - } -}) - -object HttpsGithubComAragastmatbExampleTeamcityGitRefsHeadsMaster : GitVcsRoot({ - name = "https://github.com/aragastmatb/example-teamcity.git#refs/heads/master" - url = "https://github.com/aragastmatb/example-teamcity.git" - branch = "refs/heads/master" - branchSpec = "refs/heads/*" - authMethod = password { - userName = "aragastmatb" - password = "credentialsJSON:324ac48d-364a-448d-9ba5-b42efb076fe6" - } -}) From aa212dfe1d03f86b61ff7ccfdc507be0d3af353b Mon Sep 17 00:00:00 2001 From: Alexey Metlyakov Date: Tue, 12 Oct 2021 13:38:33 +0300 Subject: [PATCH 10/10] remove some --- src/main/java/plaindoll/Welcomer.java | 3 --- src/test/java/plaindoll/WelcomerTest.java | 4 ---- 2 files changed, 7 deletions(-) diff --git a/src/main/java/plaindoll/Welcomer.java b/src/main/java/plaindoll/Welcomer.java index eea643e..940a52a 100644 --- a/src/main/java/plaindoll/Welcomer.java +++ b/src/main/java/plaindoll/Welcomer.java @@ -7,7 +7,4 @@ public class Welcomer{ public String sayFarewell() { return "Farewell, good hunter. May you find your worth in waking world."; } - public String saySome(){ - return "Some"; - } } diff --git a/src/test/java/plaindoll/WelcomerTest.java b/src/test/java/plaindoll/WelcomerTest.java index 8e87129..12c401e 100644 --- a/src/test/java/plaindoll/WelcomerTest.java +++ b/src/test/java/plaindoll/WelcomerTest.java @@ -22,9 +22,5 @@ public class WelcomerTest { assertThat(welcomer.sayWelcome(), containsString("hunter")); assertThat(welcomer.sayFarewell(), containsString("hunter")); } - @Test - public void welcomerSaysSome(){ - assertThat(welcomer.saySome(), containsString("Some")); - } } \ No newline at end of file