add deployments

This commit is contained in:
Alexander Nozik 2022-07-17 10:31:45 +03:00
parent 2e8de0b183
commit f218853544
No known key found for this signature in database
GPG Key ID: F7FCF2DD25C71357

View File

@ -22,10 +22,16 @@ job("Publish") {
//read version from build file //read version from build file
val version = java.nio.file.Path.of("build/project-version.txt").readText() val version = java.nio.file.Path.of("build/project-version.txt").readText()
val revisionSuffix = if (version.endsWith("SNAPSHOT")) {
"-" + api.gitRevision().take(7)
} else {
""
}
api.space().projects.automation.deployments.start( api.space().projects.automation.deployments.start(
project = api.projectIdentifier(), project = api.projectIdentifier(),
targetIdentifier = TargetIdentifier.Key("maps-kt"), targetIdentifier = TargetIdentifier.Key("maps-kt"),
version = version, version = version+revisionSuffix,
// automatically update deployment status based on a status of a job // automatically update deployment status based on a status of a job
syncWithAutomationJob = true syncWithAutomationJob = true
) )