diff --git a/.teamcity/delivery/arm/PushProductionLinux2004_Aarch64.kts b/.teamcity/delivery/arm/PushProductionLinux2004_Aarch64.kts index 49efd3d0a..15a736b27 100644 --- a/.teamcity/delivery/arm/PushProductionLinux2004_Aarch64.kts +++ b/.teamcity/delivery/arm/PushProductionLinux2004_Aarch64.kts @@ -25,7 +25,7 @@ object push_production_linux_2004_aarch64 : BuildType({ } features { - teamCityImageBuildFeatures() + teamCityImageBuildFeatures(useCleanup = false) } dependencies { diff --git a/.teamcity/delivery/production/PushHubLinux.kts b/.teamcity/delivery/production/PushHubLinux.kts index e54810b36..554f20d1a 100644 --- a/.teamcity/delivery/production/PushHubLinux.kts +++ b/.teamcity/delivery/production/PushHubLinux.kts @@ -22,7 +22,7 @@ object push_hub_linux : BuildType({ } features { - teamCityImageBuildFeatures(requiredSpaceGb = 4) + teamCityImageBuildFeatures(requiredSpaceGb = 4, useCleanup = false) } requirements { diff --git a/.teamcity/delivery/production/PushHubWindows.kts b/.teamcity/delivery/production/PushHubWindows.kts index 1b8ef7dcf..393b5a36b 100644 --- a/.teamcity/delivery/production/PushHubWindows.kts +++ b/.teamcity/delivery/production/PushHubWindows.kts @@ -29,7 +29,7 @@ object push_hub_windows : BuildType({ features { // Windows Images Require more disk space - teamCityImageBuildFeatures(requiredSpaceGb = 52) + teamCityImageBuildFeatures(requiredSpaceGb = 52, useCleanup = false) } requirements { diff --git a/.teamcity/delivery/production/manifest/PublishHubLatest.kts b/.teamcity/delivery/production/manifest/PublishHubLatest.kts index 943d4fc5f..05f79568c 100644 --- a/.teamcity/delivery/production/manifest/PublishHubLatest.kts +++ b/.teamcity/delivery/production/manifest/PublishHubLatest.kts @@ -44,6 +44,6 @@ object publish_hub_latest : BuildType({ } features { - teamCityImageBuildFeatures() + teamCityImageBuildFeatures(useCleanup = false) } }) diff --git a/.teamcity/delivery/production/manifest/PublishHubVersion.kts b/.teamcity/delivery/production/manifest/PublishHubVersion.kts index 20b0369ec..3596cfef3 100644 --- a/.teamcity/delivery/production/manifest/PublishHubVersion.kts +++ b/.teamcity/delivery/production/manifest/PublishHubVersion.kts @@ -44,6 +44,6 @@ object publish_hub_version : BuildType({ } features { - teamCityImageBuildFeatures() + teamCityImageBuildFeatures(useCleanup = false) } }) diff --git a/.teamcity/utils/dsl/general/DslUtils.kt b/.teamcity/utils/dsl/general/DslUtils.kt index b45d634db..dd13c9a22 100644 --- a/.teamcity/utils/dsl/general/DslUtils.kt +++ b/.teamcity/utils/dsl/general/DslUtils.kt @@ -100,16 +100,18 @@ fun Dependencies.teamCityProdImagesSnapshot() { * * @param requiredSpaceGb space required for the build (more for image build-up, less for metadata (tag)) * @param registries list of supported Docker Registries + * @param useCleanup indicates if pushed images should be cleaned up during server clean up */ fun BuildFeatures.teamCityImageBuildFeatures(requiredSpaceGb: Int = 1, - registries: List = listOf(Registries.SPACE, Registries.HUB)) { + registries: List = listOf(Registries.SPACE, Registries.HUB), + useCleanup: Boolean = false) { this.freeDiskSpace { requiredSpace = "${requiredSpaceGb}gb" failBuild = true } this.dockerSupport { - cleanupPushedImages = true + cleanupPushedImages = useCleanup loginToRegistry = on { dockerRegistryId = registries.joinToString(",") }