Setting up a new Gradle build in TeamCity requires just a few clicks:
TeamCity comes bundled with a Gradle plugin, so you do not need to install plugins additionally. However, it is recommended that you install the
TeamCity Build Scan plugin
.
Follow the
Create Project
wizard,
it will prompt for the project and build configuration name and automatically detect build steps.
Select the automatically Gradle build step and click
Use selected
:
The build step is added to the build configuration:
Click
Edit
, on the page that opens click
Advanced options
.
Using the Wrapper to execute the build is considered good practice with Gradle,
and on automatic detection this option is selected by default.
We’ll want to generate a build scan,
so we’ll enter the
--scan
option in
Additional Gradle command line parameters
field.
Save the settings and we’re ready to run the build.
Click the
Run
button in the right top corner:
TeamCity will start the build and you’ll be able to view the build progress
by clicking
Build Configuration Home
.
When the build is finished, you can review the build results by clicking the build number link:
You can view the tests right here in TeamCity:
The information on parameters and environment of the build is available
on the
Parameters
tab of the build results.
Otherwise, the link to the
build scan
for the given build is available in the build log: