Skip to content

Commit

Permalink
Merge pull request #707 from nils-a/feature/GH-702
Browse files Browse the repository at this point in the history
(GH-702) added documentation for TeamCity
  • Loading branch information
gep13 authored Oct 7, 2020
2 parents 9e96d79 + 8e0600d commit f7b0621
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 1 deletion.
57 changes: 56 additions & 1 deletion docs/input/docs/ci-systems/teamcity.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,59 @@ Title: TeamCity
Description: Running on TeamCity
---

This documentation is currently missing.
## Specifics

* `vcsroot.branch`-environment variable

Exposing the `vcsroot.branch` parameter as an environment variable is required.

## Example Config

Generally, TeamCity is configured using the UI:

* Add a new build configuration to your project
* Select a VCS-Root
* Chose "configure build steps manually" (and skip auto-detection)
* Select "PowerShell" as Runner type
* Add `build.ps1` as "Script file" and optionally some "Script arguments"

![build.ps1 in script file](./teamcity/build-step.png){.img-responsive}
* Select "Parameters" and a new parameter
* chose `env.vcsroot.branch` as Name,
* "Environment Variable" as Kind,
* `%vcsroot.branch%` as Value

![env.vscroot.brach variable](./teamcity/parameter.png){.img-responsive}
* At this point you are done with the basic setup and can select "Run" to try the new configuration.

The following code shows the Kotlin DSL, as can be exported in TeamCity-UI.
Though generally the build is configured using the TeamCity-UI.

```java
object Cake : BuildType({
name = "Cake"

params {
param("env.vcsroot.branch", "%vcsroot.branch%")
}

vcs {
root(SomeConfiguredVcsRoot)
}

steps {
powerShell {
scriptMode = file {
path = "build.ps1"
}
noProfile = false
param("jetbrains_powershell_scriptArguments", "--verbosity=Diagnostic")
}
}

triggers {
vcs {
}
}
})
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/input/docs/ci-systems/teamcity/parameter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f7b0621

Please sign in to comment.