TeamCity 2020.2 Help

Personal Build

A personal build is a build-out of the common build sequence which typically uses the changes not yet committed into the version control. Personal builds are usually initiated from one of the supported IDEs via the Remote Run procedure. You can also upload a patch with changes directly to the server, as described below.

A personal build uses the current VCS repository sources plus the changed files identified during the remote run initiation. The results of a personal build can be seen in the "My Changes" view of the corresponding IDE plugin and on the Changes page in TeamCity. Finished personal builds are listed in the build history, but only for the users who initiated them.
Read more about running commits via Remote Run in Pre-Tested (Delayed) Commit.

By default, users only see their own personal builds in the build lists, but this can be changed via the "Show all personal builds" option in My Settings & Tools | General | UI settings of the user profile.

You can also mark a build as personal using the corresponding option of the Run dialog.
By default, only users with the Project Developer role can initiate a personal build.

It is possible to restrict running personal builds in the General Settings of a build configuration.

Direct Patch Upload

You can upload a patch with local changes directly to the TeamCity server, via our web UI or REST API.

TeamCity supports patches in a unified diff format.

To generate a patch:

  • In any IntelliJ Platform IDE: select the required local changes in the commit log, click Create Patch in the context menu, and save the patch as a *.diff file.

  • Via Git: run git diff commit1..commit2 > path/filename.diff.
    For example, to save a diff between the last commit and the preceding commit to the patch.diff file in the test folder, run git diff HEAD^ HEAD > ~/test/patch.diff. See other examples in Git documentation.

To upload a patch and run a personal build via the web UI:

  1. Open the Run Custom Build dialog and enable the "run as a personal build" option. The Upload patch button will appear.

    Upload a unidiff patch via UI

  2. Upload the patch and click Run Build.
    The agent will receive the patch and apply it before running the build. After the build, it will revert the patch, so the checkout directory can be reused by subsequent builds.

To upload a patch and run a personal build via REST API:

  1. Send the following POST request:

    curl \ -X POST \ -H "Content-Type: text/text" \ -H "Origin: <host>:<port>" \ --data-binary @patch.diff \ "http://<username>:<password>@<host>:<port>/uploadDiffChanges.html?description=<description-text>&commitType=0"

    As a response, you will receive the ID of this change on the server.

  2. Create an XML file that describes the build node and mentions the build configuration ID and the ID of your personal change:

    <build personal="true"> <triggered type='idePlugin' details='Unified Diff Patch'/> <triggeringOptions cleanSources="false" rebuildAllDependencies="false" queueAtTop="false"/> <buildType id="<build_configuration_id>"/> <lastChanges> <change id="<change_ID>" personal="true"/> </lastChanges> </build>
  3. To trigger a personal build via REST API, post the created file to the buildQueue endpoint:

    curl \ -X POST \ -H "Content-Type: application/xml" \ -H "Origin: <host>:<port>" \ --data @node.xml \ "http://<username>:<password>@<host>:<port>/app/rest/buildQueue"

    The agent will receive the patch and apply it before running the build. After the build, it will revert the patch, so the checkout directory can be reused by subsequent builds.

Last modified: 28 April 2020