forked from gradle/gradle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'teamcity-versioned-settings' into master
- Loading branch information
Showing
48 changed files
with
2,844 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package Gradle_AgentTest | ||
|
||
import jetbrains.buildServer.configs.kotlin.v2018_1.project | ||
import jetbrains.buildServer.configs.kotlin.v2018_1.version | ||
import model.CIBuildModel | ||
import model.JvmVersion | ||
import model.NoBuildCache | ||
import model.OS | ||
import model.SpecificBuild | ||
import model.Stage | ||
import model.StageNames | ||
import model.TestCoverage | ||
import model.TestType | ||
import projects.RootProject | ||
|
||
/* | ||
The settings script is an entry point for defining a single | ||
TeamCity project. TeamCity looks for the 'settings.kts' file in a | ||
project directory and runs it if it's found, so the script name | ||
shouldn't be changed and its package should be the same as the | ||
project's id. | ||
The script should contain a single call to the project() function | ||
with a Project instance or an init function as an argument. | ||
VcsRoots, BuildTypes, and Templates of this project must be | ||
registered inside project using the vcsRoot(), buildType(), and | ||
template() methods respectively. | ||
Subprojects can be defined either in their own settings.kts or by | ||
calling the subProjects() method in this project. | ||
To debug settings scripts in command-line, run the | ||
mvnDebug org.jetbrains.teamcity:teamcity-configs-maven-plugin:generate | ||
command and attach your debugger to the port 8000. | ||
To debug in IntelliJ Idea, open the 'Maven Projects' tool window (View -> | ||
Tool Windows -> Maven Projects), find the generate task | ||
node (Plugins -> teamcity-configs -> teamcity-configs:generate), | ||
the 'Debug' option is available in the context menu for the task. | ||
*/ | ||
|
||
version = "2018.1" | ||
val buildModel = CIBuildModel( | ||
projectPrefix = "Gradle_AgentTest_", | ||
rootProjectName = "Test Build Agents", | ||
masterAndReleaseBranches = listOf("master"), | ||
parentBuildCache = NoBuildCache, | ||
childBuildCache = NoBuildCache, | ||
tagBuilds = false, | ||
publishStatusToGitHub = false, | ||
buildScanTags = listOf("AgentTest"), | ||
stages = listOf( | ||
Stage(StageNames.QUICK_FEEDBACK_LINUX_ONLY, | ||
runsIndependent = true, | ||
specificBuilds = listOf(SpecificBuild.CompileAll, SpecificBuild.SanityCheck), | ||
functionalTests = listOf(TestCoverage(TestType.quick, OS.linux, JvmVersion.java8))) | ||
) | ||
) | ||
project(RootProject(buildModel)) |
15 changes: 15 additions & 0 deletions
15
.teamcity/Gradle_Check/configurations/BaseGradleBuildType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package configurations | ||
|
||
import jetbrains.buildServer.configs.kotlin.v2018_1.BuildType | ||
import model.BuildCache | ||
import model.CIBuildModel | ||
import model.Stage | ||
|
||
open class BaseGradleBuildType(model: CIBuildModel, val stage: Stage? = null, usesParentBuildCache: Boolean = false, init: BaseGradleBuildType.() -> Unit = {}) : BuildType() { | ||
|
||
val buildCache: BuildCache = if (usesParentBuildCache) model.parentBuildCache else model.childBuildCache | ||
|
||
init { | ||
this.init() | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
.teamcity/Gradle_Check/configurations/BuildDistributions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package configurations | ||
|
||
import jetbrains.buildServer.configs.kotlin.v2018_1.AbsoluteId | ||
import model.CIBuildModel | ||
import model.Stage | ||
|
||
class BuildDistributions(model: CIBuildModel, stage: Stage) : BaseGradleBuildType(model, stage = stage, init = { | ||
uuid = "${model.projectPrefix}BuildDistributions" | ||
id = AbsoluteId(uuid) | ||
name = "Build Distributions" | ||
description = "Creation and verification of the distribution and documentation" | ||
|
||
applyDefaults(model, this, "packageBuild", extraParameters = buildScanTag("BuildDistributions") + " -PtestJavaHome=${distributionTestJavaHome}", daemon = false) | ||
|
||
artifactRules = """$artifactRules | ||
build/distributions/*.zip => distributions | ||
build/build-receipt.properties | ||
""".trimIndent() | ||
|
||
params { | ||
param("env.JAVA_HOME", buildJavaHome) | ||
} | ||
}) |
12 changes: 12 additions & 0 deletions
12
.teamcity/Gradle_Check/configurations/BuildJavaVersions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package configurations | ||
|
||
|
||
private val linuxJava8Oracle = "%linux.java8.oracle.64bit%" | ||
private val linuxJava9Oracle = "%linux.java9.oracle.64bit%" | ||
|
||
val buildJavaHome = linuxJava9Oracle | ||
val coordinatorPerformanceTestJavaHome = linuxJava8Oracle | ||
val individualPerformanceTestJavaHome = linuxJava8Oracle | ||
val smokeTestJavaHome = linuxJava8Oracle | ||
val distributionTestJavaHome = linuxJava9Oracle | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package configurations | ||
|
||
import jetbrains.buildServer.configs.kotlin.v2018_1.AbsoluteId | ||
import model.CIBuildModel | ||
import model.Stage | ||
|
||
class CompileAll(model: CIBuildModel, stage: Stage) : BaseGradleBuildType(model, stage = stage, usesParentBuildCache = true, init = { | ||
uuid = buildTypeId(model) | ||
id = AbsoluteId(uuid) | ||
name = "Compile All" | ||
description = "Compiles all the source code and warms up the build cache" | ||
|
||
params { | ||
param("system.java9Home", "%linux.java9.oracle.64bit%") | ||
param("env.JAVA_HOME", buildJavaHome) | ||
} | ||
|
||
if (model.publishStatusToGitHub) { | ||
features { | ||
publishBuildStatusToGithub() | ||
} | ||
} | ||
|
||
applyDefaults( | ||
model, | ||
this, | ||
":createBuildReceipt -PignoreIncomingBuildReceipt=true compileAll", | ||
extraParameters = buildScanTag("CompileAll") | ||
) | ||
|
||
artifactRules = """$artifactRules | ||
build/build-receipt.properties | ||
""".trimIndent() | ||
}) { | ||
companion object { | ||
fun buildTypeId(model: CIBuildModel) = "${model.projectPrefix}CompileAll" | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
.teamcity/Gradle_Check/configurations/DependenciesCheck.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package configurations | ||
|
||
import jetbrains.buildServer.configs.kotlin.v2018_1.AbsoluteId | ||
import model.CIBuildModel | ||
import model.Stage | ||
|
||
class DependenciesCheck(model: CIBuildModel, stage: Stage) : BaseGradleBuildType(model, stage = stage, init = { | ||
uuid = "${model.projectPrefix}DependenciesCheck" | ||
id = AbsoluteId(uuid) | ||
name = "Dependencies Check - Java8 Linux" | ||
description = "Checks external dependencies in Gradle distribution for known, published vulnerabilities" | ||
|
||
params { | ||
param("env.JAVA_HOME", buildJavaHome) | ||
} | ||
|
||
applyDefaults( | ||
model, | ||
this, | ||
"dependencyCheckAnalyze", | ||
notQuick = true, | ||
extraParameters = buildScanTag("DependenciesCheck") | ||
) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package configurations | ||
|
||
import jetbrains.buildServer.configs.kotlin.v2018_1.AbsoluteId | ||
import model.CIBuildModel | ||
import model.OS | ||
import model.Stage | ||
import model.TestCoverage | ||
import model.TestType | ||
|
||
class FunctionalTest(model: CIBuildModel, testCoverage: TestCoverage, subProject: String = "", useDaemon: Boolean = true, stage: Stage) : BaseGradleBuildType(model, stage = stage, init = { | ||
uuid = testCoverage.asConfigurationId(model, subProject) | ||
id = AbsoluteId(uuid) | ||
name = testCoverage.asName() + if (!subProject.isEmpty()) " ($subProject)" else "" | ||
val testTask = if (!subProject.isEmpty()) { | ||
subProject + ":" | ||
} else { | ||
"" | ||
} + testCoverage.testType.name + "Test" | ||
val quickTest = testCoverage.testType == TestType.quick | ||
val buildScanTags = listOf("FunctionalTest") | ||
val buildScanValues = mapOf( | ||
"coverageOs" to testCoverage.os.name, | ||
"coverageJvmVendor" to testCoverage.vendor.name, | ||
"coverageJvmVersion" to testCoverage.testJvmVersion.name | ||
) | ||
applyDefaults(model, this, testTask, notQuick = !quickTest, os = testCoverage.os, | ||
extraParameters = ( | ||
listOf(""""-PtestJavaHome=%${testCoverage.os}.${testCoverage.testJvmVersion}.${testCoverage.vendor}.64bit%"""") | ||
+ buildScanTags.map { buildScanTag(it) } | ||
+ buildScanValues.map { buildScanCustomValue(it.key, it.value) } | ||
).joinToString(separator = " "), | ||
timeout = testCoverage.testType.timeout, | ||
daemon = useDaemon) | ||
|
||
params { | ||
param("env.JAVA_HOME", "%${testCoverage.os}.${testCoverage.buildJvmVersion}.oracle.64bit%") | ||
if (testCoverage.os == OS.linux) { | ||
param("env.ANDROID_HOME", "/opt/android/sdk") | ||
} | ||
} | ||
}) |
Oops, something went wrong.