|
| 1 | +package patches.buildTypes |
| 2 | + |
| 3 | +import jetbrains.buildServer.configs.kotlin.* |
| 4 | +import jetbrains.buildServer.configs.kotlin.BuildType |
| 5 | +import jetbrains.buildServer.configs.kotlin.buildFeatures.nuGetFeedCredentials |
| 6 | +import jetbrains.buildServer.configs.kotlin.buildFeatures.perfmon |
| 7 | +import jetbrains.buildServer.configs.kotlin.buildSteps.dotnetBuild |
| 8 | +import jetbrains.buildServer.configs.kotlin.buildSteps.dotnetRestore |
| 9 | +import jetbrains.buildServer.configs.kotlin.buildSteps.dotnetTest |
| 10 | +import jetbrains.buildServer.configs.kotlin.buildSteps.script |
| 11 | +import jetbrains.buildServer.configs.kotlin.failureConditions.BuildFailureOnMetric |
| 12 | +import jetbrains.buildServer.configs.kotlin.failureConditions.BuildFailureOnText |
| 13 | +import jetbrains.buildServer.configs.kotlin.failureConditions.failOnMetricChange |
| 14 | +import jetbrains.buildServer.configs.kotlin.failureConditions.failOnText |
| 15 | +import jetbrains.buildServer.configs.kotlin.triggers.vcs |
| 16 | +import jetbrains.buildServer.configs.kotlin.ui.* |
| 17 | + |
| 18 | +/* |
| 19 | +This patch script was generated by TeamCity on settings change in UI. |
| 20 | +To apply the patch, create a buildType with id = 'LibrariesBuildAndTest' |
| 21 | +in the root project, and delete the patch script. |
| 22 | +*/ |
| 23 | +create(DslContext.projectId, BuildType({ |
| 24 | + id("LibrariesBuildAndTest") |
| 25 | + name = "Libraries build and test" |
| 26 | + |
| 27 | + artifactRules = """ |
| 28 | + +:artifacts/NoeticTools.*.nupkg |
| 29 | + +:src/SolutionVersioningProject/obj/Git2SemVer.MSBuild.log |
| 30 | + +:src/SolutionVersioningProject/.git2semver/Git2SemVer.VersionInfo.g.json |
| 31 | + """.trimIndent() |
| 32 | + |
| 33 | + params { |
| 34 | + param("BuildConfiguration", "Release") |
| 35 | + } |
| 36 | + |
| 37 | + vcs { |
| 38 | + root(DslContext.settingsRoot) |
| 39 | + |
| 40 | + cleanCheckout = true |
| 41 | + } |
| 42 | + |
| 43 | + steps { |
| 44 | + script { |
| 45 | + name = "Clear NuGet caches" |
| 46 | + id = "Clear_NuGet_caches" |
| 47 | + enabled = false |
| 48 | + scriptContent = "dotnet nuget locals all --clear" |
| 49 | + } |
| 50 | + dotnetRestore { |
| 51 | + name = "Restore" |
| 52 | + id = "Restore" |
| 53 | + sources = "https://api.nuget.org/v3/index.json" |
| 54 | + } |
| 55 | + dotnetBuild { |
| 56 | + name = "Build" |
| 57 | + id = "dotnet" |
| 58 | + configuration = "%BuildConfiguration%" |
| 59 | + args = "-p:Git2SemVer_BuildNumber=%build.number% --verbosity normal" |
| 60 | + } |
| 61 | + dotnetTest { |
| 62 | + name = "Test" |
| 63 | + id = "dotnet_1" |
| 64 | + configuration = "%BuildConfiguration%" |
| 65 | + skipBuild = true |
| 66 | + args = "--logger console --logger teamcity" |
| 67 | + param("dotNetCoverage.dotCover.filters", """ |
| 68 | + +:NoeticTools.* |
| 69 | + -:NoeticTools.*Tests |
| 70 | + """.trimIndent()) |
| 71 | + } |
| 72 | + } |
| 73 | + |
| 74 | + triggers { |
| 75 | + vcs { |
| 76 | + } |
| 77 | + } |
| 78 | + |
| 79 | + failureConditions { |
| 80 | + executionTimeoutMin = 4 |
| 81 | + failOnMetricChange { |
| 82 | + enabled = false |
| 83 | + metric = BuildFailureOnMetric.MetricType.TEST_COUNT |
| 84 | + threshold = 20 |
| 85 | + units = BuildFailureOnMetric.MetricUnit.PERCENTS |
| 86 | + comparison = BuildFailureOnMetric.MetricComparison.LESS |
| 87 | + compareTo = build { |
| 88 | + buildRule = lastSuccessful() |
| 89 | + } |
| 90 | + } |
| 91 | + failOnMetricChange { |
| 92 | + metric = BuildFailureOnMetric.MetricType.ARTIFACT_SIZE |
| 93 | + threshold = 25 |
| 94 | + units = BuildFailureOnMetric.MetricUnit.PERCENTS |
| 95 | + comparison = BuildFailureOnMetric.MetricComparison.LESS |
| 96 | + compareTo = build { |
| 97 | + buildRule = lastSuccessful() |
| 98 | + } |
| 99 | + } |
| 100 | + failOnText { |
| 101 | + conditionType = BuildFailureOnText.ConditionType.CONTAINS |
| 102 | + pattern = "The service message is invalid because it does not end with ] character" |
| 103 | + failureMessage = "Service message corruption detected" |
| 104 | + reverse = false |
| 105 | + stopBuildOnFailure = true |
| 106 | + } |
| 107 | + } |
| 108 | + |
| 109 | + features { |
| 110 | + perfmon { |
| 111 | + } |
| 112 | + nuGetFeedCredentials { |
| 113 | + feedUrl = "https://api.nuget.org/v3/index.json" |
| 114 | + username = "credentialsJSON:048b1358-2a0f-4d8f-917b-62869330ea79" |
| 115 | + password = "credentialsJSON:5577d5f6-64ef-4a22-868b-03a7d05985e6" |
| 116 | + } |
| 117 | + } |
| 118 | + |
| 119 | + requirements { |
| 120 | + exists("DotNetCLI_Path") |
| 121 | + } |
| 122 | +})) |
| 123 | + |
0 commit comments