Skip to content

Commit

Permalink
[TEAMCITY-QA-T] Remove unused build configuration with duplicated fun…
Browse files Browse the repository at this point in the history
…ctionality (#113)

* Remove unused build configuration, whose functionality exists within different configurations.
* Update VCS root for the sculed build of Windows images.
* Update DSL generator with the removal of deprecated DSL code, just in case.
  • Loading branch information
AndreyKoltsov1997 authored Sep 26, 2023
1 parent 4daaf42 commit bf69871
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 60 deletions.
47 changes: 0 additions & 47 deletions .teamcity/delivery/BuildAndPushHosted.kts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package scheduled.build

import common.TeamCityDockerImagesRepo.TeamCityDockerImagesRepo
import common.TeamCityDockerImagesRepo_AllBranches
import scheduled.build.model.DockerImageInfo
import utils.dsl.general.teamCityBuildDistDocker
import jetbrains.buildServer.configs.kotlin.v2019_2.AbsoluteId
Expand All @@ -21,7 +22,7 @@ object TeamCityScheduledImageBuildWindows : BuildType({
name = "TeamCity Docker Images - Automated Scheduled Build - Windows"

vcs {
root(TeamCityDockerImagesRepo)
root(TeamCityDockerImagesRepo_AllBranches)
}

steps {
Expand All @@ -45,7 +46,7 @@ object TeamCityScheduledImageBuildWindows : BuildType({
teamCityImageBuildFeatures(requiredSpaceGb = 50)
}

// An implicit Windoiws 10 requirement has been added in order to prevent DotNet's WebClient internal exception.
// An implicit Windows 10 requirement has been added in order to prevent DotNet's WebClient internal exception.
requirements {
contains("teamcity.agent.jvm.os.name", "Windows 10")
}
Expand Down
6 changes: 4 additions & 2 deletions .teamcity/settings.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import common.TeamCityDockerImagesRepo.TeamCityDockerImagesRepo
import common.TeamCityDockerImagesRepo_AllBranches
import delivery.BuildAndPushHosted
import delivery.HubProject
import delivery.LocalProject
import scheduled.build.TeamCityDockerImagesScheduledBuild
Expand All @@ -17,10 +16,13 @@ object RootProject : Project({
vcsRoot(TeamCityDockerImagesRepo)
vcsRoot(TeamCityDockerImagesRepo_AllBranches)

// Staging registry
subProject(LocalProject.LocalProject)

// Production registry
subProject(HubProject.HubProject)

buildType(BuildAndPushHosted.BuildAndPushHosted)
// Scheduled Builds
buildType(TeamCityDockerImagesScheduledBuild.TeamCityDockerImagesScheduledBuild)
buildType(TeamCityScheduledImageBuildWindows.TeamCityScheduledImageBuildWindows)
buildType(TeamCityScheduledImageBuildLinux_Base("amd64", "linux"))
Expand Down
10 changes: 1 addition & 9 deletions tool/TeamCity.Docker/TeamCityKotlinSettingsGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,6 @@ private FileArtifact AddFile(string fileName, IEnumerable<string> lines)
"import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.VcsTrigger",
"import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.finishBuildTrigger",
"import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.vcs",
// -- Build Configurations
"import hosted.BuildAndPushHosted",

string.Empty
};
Expand Down Expand Up @@ -483,15 +481,9 @@ private IEnumerable<string> CreateImageValidationConfig(string buildTypeId, IEnu
"\t }"
);

// Generation of build configuration is deprecated, thus no dependencies are set.
yield return String.Join('\n',
"\n\t dependencies {",
"\t // Dependency on the build of the Docker image",
"\t\t dependency(BuildAndPushHosted.BuildAndPushHosted) {",
"\t\t\t snapshot {",
"\t\t\t\t onDependencyFailure = FailureAction.FAIL_TO_START",
"\t\t\t\t reuseBuilds = ReuseBuilds.SUCCESSFUL",
"\t\t\t }",
"\t\t }",
"\t}"
);

Expand Down

0 comments on commit bf69871

Please sign in to comment.