-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#69) Add TeamCity Kotlin Configuration
Based on a successful execution of the build in development environment, let's bring that configuration into source control, so that we can run it from here.
- Loading branch information
Showing
2 changed files
with
194 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<?xml version="1.0"?> | ||
<project> | ||
<modelVersion>4.0.0</modelVersion> | ||
<name>ChocoCCM Config DSL Script</name> | ||
<groupId>ChocoCCM</groupId> | ||
<artifactId>ChocoCCM</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
|
||
<parent> | ||
<groupId>org.jetbrains.teamcity</groupId> | ||
<artifactId>configs-dsl-kotlin-parent</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<repositories> | ||
<repository> | ||
<id>jetbrains-all</id> | ||
<url>https://download.jetbrains.com/teamcity-repository</url> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
</snapshots> | ||
</repository> | ||
<repository> | ||
<id>teamcity-server</id> | ||
<url>https://teamcityserver/app/dsl-plugins-repository</url> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
</snapshots> | ||
</repository> | ||
</repositories> | ||
|
||
<pluginRepositories> | ||
<pluginRepository> | ||
<id>JetBrains</id> | ||
<url>https://download.jetbrains.com/teamcity-repository</url> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
|
||
<build> | ||
<sourceDirectory>${basedir}</sourceDirectory> | ||
<plugins> | ||
<plugin> | ||
<artifactId>kotlin-maven-plugin</artifactId> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
<version>${kotlin.version}</version> | ||
|
||
<configuration/> | ||
<executions> | ||
<execution> | ||
<id>compile</id> | ||
<phase>process-sources</phase> | ||
<goals> | ||
<goal>compile</goal> | ||
</goals> | ||
</execution> | ||
<execution> | ||
<id>test-compile</id> | ||
<phase>process-test-sources</phase> | ||
<goals> | ||
<goal>test-compile</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.jetbrains.teamcity</groupId> | ||
<artifactId>teamcity-configs-maven-plugin</artifactId> | ||
<version>${teamcity.dsl.version}</version> | ||
<configuration> | ||
<format>kotlin</format> | ||
<dstDir>target/generated-configs</dstDir> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.jetbrains.teamcity</groupId> | ||
<artifactId>configs-dsl-kotlin</artifactId> | ||
<version>${teamcity.dsl.version}</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jetbrains.teamcity</groupId> | ||
<artifactId>configs-dsl-kotlin-plugins</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<type>pom</type> | ||
<scope>compile</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
<artifactId>kotlin-stdlib-jdk8</artifactId> | ||
<version>${kotlin.version}</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
<artifactId>kotlin-script-runtime</artifactId> | ||
<version>${kotlin.version}</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
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,90 @@ | ||
import jetbrains.buildServer.configs.kotlin.v2019_2.* | ||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.PullRequests | ||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.pullRequests | ||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.powerShell | ||
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.vcs | ||
|
||
project { | ||
buildType(ChocoCCM) | ||
} | ||
|
||
object ChocoCCM : BuildType({ | ||
id = AbsoluteId("ChocoCCM") | ||
name = "Build" | ||
|
||
artifactRules = """ | ||
+:Output/*.xml | ||
+:Output/ChocoCCM/** | ||
""".trimIndent() | ||
|
||
params { | ||
param("env.vcsroot.branch", "%vcsroot.branch%") | ||
param("env.Git_Branch", "%teamcity.build.vcs.branch.ChocoCCM_ChocoCCMVcsRoot%") | ||
param("teamcity.git.fetchAllHeads", "true") | ||
password("env.GITHUB_PAT", "%system.GitHubPAT%", display = ParameterDisplay.HIDDEN, readOnly = true) | ||
} | ||
|
||
vcs { | ||
root(DslContext.settingsRoot) | ||
|
||
branchFilter = """ | ||
+:* | ||
""".trimIndent() | ||
} | ||
|
||
steps { | ||
step { | ||
name = "Include Signing Keys" | ||
type = "PrepareSigningEnvironment" | ||
} | ||
powerShell { | ||
name = "BootstrapPSGet Task" | ||
formatStderrAsError = true | ||
scriptMode = script { | ||
content = """ | ||
try { | ||
& .\build.ps1 -Task BootstrapPSGet -Verbose -ErrorAction Stop | ||
} | ||
catch { | ||
${'$'}_ | Out-String | Write-Host -ForegroundColor Red | ||
exit 1 | ||
} | ||
""".trimIndent() | ||
} | ||
noProfile = false | ||
} | ||
powerShell { | ||
name = "CI Task" | ||
formatStderrAsError = true | ||
scriptMode = script { | ||
content = """ | ||
try { | ||
& .\build.ps1 -Task CI -Verbose -ErrorAction Stop | ||
} | ||
catch { | ||
${'$'}_ | Out-String | Write-Host -ForegroundColor Red | ||
exit 1 | ||
} | ||
""".trimIndent() | ||
} | ||
noProfile = false | ||
param("jetbrains_powershell_script_file", "build.ps1") | ||
} | ||
} | ||
|
||
triggers { | ||
vcs { | ||
branchFilter = "" | ||
} | ||
} | ||
|
||
features { | ||
pullRequests { | ||
provider = github { | ||
authType = token { | ||
token = "%system.GitHubPAT%" | ||
} | ||
} | ||
} | ||
} | ||
}) |