Skip to content

Commit 96a46c3

Browse files
committed
Settings generator: introduce option to use single Mac agent for deployment
1 parent b88a630 commit 96a46c3

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

main/resources/teamcity/settings.kts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,18 @@ project {
5050
reuseBuilds = ReuseBuilds.NO
5151
}
5252
}
53-
val deploys = platforms.map { deploy(it, deployVersion) }
53+
val deploys = platforms.associateWith { deploy(it, deployVersion) }
5454
val deployPublish = deployPublish(deployVersion).apply {
5555
dependsOnSnapshot(buildAll, onFailure = FailureAction.IGNORE)
5656
dependsOnSnapshot(BUILD_CREATE_STAGING_REPO_ABSOLUTE_ID) {
5757
reuseBuilds = ReuseBuilds.NO
5858
}
59-
deploys.forEach {
60-
dependsOnSnapshot(it)
61-
}
59+
deploys
60+
.filter { (platform, _) -> !singleAgentMacDeployment || platform == Platform.MacOS }
61+
.forEach { dependsOnSnapshot(it.value) }
6262
}
6363

64-
buildTypesOrder = listOf(buildAll, buildVersion, *builds.toTypedArray(), deployPublish, deployVersion, *deploys.toTypedArray())
64+
buildTypesOrder = listOf(buildAll, buildVersion, *builds.toTypedArray(), deployPublish, deployVersion, *deploys.values.toTypedArray())
6565

6666
additionalConfiguration()
6767
}

main/resources/teamcity/utils.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const val teamcitySuffixParameter = "teamcitySuffix"
1010
const val releaseVersionParameter = "releaseVersion"
1111

1212
const val libraryStagingRepoDescription = "<<LIBRARY_STAGING_REPO_DESCRIPTION>>"
13+
const val singleAgentMacDeployment: Boolean = <<SINGLE_AGENT_MAC_DEPLOYMENT>>
1314

1415
val platforms = Platform.values()
1516
const val jdk = "<<JDK>>"

main/src/kotlinx/team/infra/Publishing.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ open class PublishingConfiguration @Inject constructor(val objects: ObjectFactor
3333
fun include(vararg name: String) {
3434
includeProjects.addAll(name)
3535
}
36+
37+
/**
38+
* Build all artifacts for publishing and deploy them from a single mac agent.
39+
*/
40+
var singleAgentMacDeployment: Boolean = false
3641
}
3742

3843
open class SonatypeConfiguration {

main/src/kotlinx/team/infra/TeamCity.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ fun Project.configureTeamCityConfigGenerator(teamcity: TeamCityConfiguration, pu
5555
text
5656
.replace("<<LIBRARY_STAGING_REPO_DESCRIPTION>>", libraryStagingRepoDescription)
5757
.replace("<<JDK>>", teamcity.jdk)
58+
.replace("<<SINGLE_AGENT_MAC_DEPLOYMENT>>", publishing.singleAgentMacDeployment.toString())
5859
}
5960
copyResource(teamcityDir, "additionalConfiguration.kt", override = false)
6061
copyResource(teamcityDir, "settings.kts")

0 commit comments

Comments
 (0)