Skip to content

Settings generator: use single Mac agent for deployment #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions main/resources/teamcity/settings.kts
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,18 @@ project {
reuseBuilds = ReuseBuilds.NO
}
}
val deploys = platforms.map { deploy(it, deployVersion) }
val deploys = platforms.associateWith { deploy(it, deployVersion) }
val deployPublish = deployPublish(deployVersion).apply {
dependsOnSnapshot(buildAll, onFailure = FailureAction.IGNORE)
dependsOnSnapshot(BUILD_CREATE_STAGING_REPO_ABSOLUTE_ID) {
reuseBuilds = ReuseBuilds.NO
}
deploys.forEach {
dependsOnSnapshot(it)
}
deploys
.filter { (platform, _) -> !singleAgentMacDeployment || platform == Platform.MacOS }
.forEach { dependsOnSnapshot(it.value) }
}

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

additionalConfiguration()
}
Expand Down
1 change: 1 addition & 0 deletions main/resources/teamcity/utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const val teamcitySuffixParameter = "teamcitySuffix"
const val releaseVersionParameter = "releaseVersion"

const val libraryStagingRepoDescription = "<<LIBRARY_STAGING_REPO_DESCRIPTION>>"
const val singleAgentMacDeployment: Boolean = <<SINGLE_AGENT_MAC_DEPLOYMENT>>

val platforms = Platform.values()
const val jdk = "<<JDK>>"
Expand Down
5 changes: 5 additions & 0 deletions main/src/kotlinx/team/infra/Publishing.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ open class PublishingConfiguration @Inject constructor(val objects: ObjectFactor
fun include(vararg name: String) {
includeProjects.addAll(name)
}

/**
* Build all artifacts for publishing and deploy them from a single mac agent.
*/
var singleAgentMacDeployment: Boolean = false
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps, it'd be better to place it in teamcity DSL block because it affects generated teamcity build configurations?
On the other hand, libraryStagingRepoDescription was recently moved (see the commit 25e3650) from teamcity to publishing/sonatype block, because while it also affects TC configurations, it is semantically closer to sonatype publishing.
WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "publishing" DSL is the appropriate place for the property. It affects publishing, even if only in TeamCity.

}

open class SonatypeConfiguration {
Expand Down
1 change: 1 addition & 0 deletions main/src/kotlinx/team/infra/TeamCity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ fun Project.configureTeamCityConfigGenerator(teamcity: TeamCityConfiguration, pu
text
.replace("<<LIBRARY_STAGING_REPO_DESCRIPTION>>", libraryStagingRepoDescription)
.replace("<<JDK>>", teamcity.jdk)
.replace("<<SINGLE_AGENT_MAC_DEPLOYMENT>>", publishing.singleAgentMacDeployment.toString())
}
copyResource(teamcityDir, "additionalConfiguration.kt", override = false)
copyResource(teamcityDir, "settings.kts")
Expand Down