In your IDEA, File
- Open
, select .teamcity/pom.xml
, import as project
, and you'll have a Maven project.
Mostly a standard Maven project structure. The entry point settings.kts
defines the TeamCity project.
There are 3 subprojects in the TeamCity project hierarchy: Check
for Gradle builds, Promotion
for releasing Gradle versions, Util
for miscellaneous utilities.
After you make a change, you can run mvn clean teamcity-configs:generate
to generate and verify the generated TeamCity configuration XMLs.
You also need to run mvn clean verify
with Java 8 before committing changes.
If you have ktlint errors, you can automatically fix them by running mvn com.github.gantsign.maven:ktlint-maven-plugin:1.1.1:format
.
We use Kotlin portable DSL to store TeamCity configuration, which means you can easily create a new pipeline based on a specific branch. Currently, we have two pipelines: master
and release
, but you can easily create and test another isolated pipeline from any branch.
We‘ll explain everything via an example. Let’s say you make some changes on your branch myTestBranch
(we highly recommend to name this branch without prefix and hypen (-
) because it's used to generated build type ID) and want to test these change without affecting master
/release
pipeline, here are the instructions.
MyNewVcsRoot
. Set “default branch” to myTestBranch
where your code exists.Create subproject
button at the bottom of “Subprojects” region of this pageManually
.MyTestBranch
.Gradle_MyTestBranch
. If not, you probably selected wrong parent, the “Parent project” should be Gradle
.https://builds.gradle.org/admin/editProject.html?projectId=Gradle_<MyTestBranch>
.Versioned Settings
on the left side bar.Synchronization enabled
- use settings from VCS
- MyNewVcsRoot
(the one you just created) - Settings format: Kotlin
, then Apply
.Import Settings from VCS
. Wait a few seconds.Branch
with value myTestBranch
. Go back and it automatically reloads.Synchronization disabled
, then repeat the step above. Otherwise, TeamCity complains “Can't find the previous revision, please commit current settings first”.Synchronization disabled
before deleting it).If no errors, your new pipeline will be displayed on TeamCity web UI:
Gradle |------ Master | |--------- ... | |------ Release | |--------- ... | |------ MyTestBranch |---------- Check | |--------- QuickFeedbackLinux | |--------- QuickFeedback | |--------- ... | |--------- ReadyForRelease | |---------- Promotion | |--------- Publish Nightly Snapshot | |--------- Publish Branch Snapshot | |--------- ... | |---------- Util |--------- ...