Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to specify when a Build Feature is to be run?

TeamCity 8.1.4 (build 30168)

I notice that Build Features are always run as first part of first step in the Build Steps, but is it possible to make a Build Feature run e.g. as first part of step2? Or as last part of Step1?
Any help is appreciated!

(If it is of interest, this is my concrete problem;
I have a meta runner that creates a specific build number, I use this as a first step in the build steps. I want to use the build feature "AssemblyInfo patcher", but this runs before the meta runner has done its thing)

like image 754
Gard E. Avatar asked Jan 09 '15 14:01

Gard E.


People also ask

How do I manually trigger a build in TeamCity?

To run a custom build with specific changes, open the build results page, go to the Changes tab, expand the required change, click the Run build with this change, and proceed with the options in the Run Custom Build dialog. Use HTTP request or REST API request to TeamCity to trigger a build.

What are build configurations?

A build configuration is a collection of settings used to start a build and group the sequence of the builds in the UI. Examples of build configurations are distribution, integration tests, prepare release distribution, "nightly" build. A build configuration belongs to a project and contains builds.

What are build features?

A build feature is a piece of functionality that can be added to a build configuration to affect running builds or reporting build results. The Build Configuration Settings | Build Features page displays the configured features and allows you to manage them.

How to see build steps in TeamCity?

In Build Steps, click Auto-detect build steps, and then select the proposed steps you want to add to the current build configuration. You can change their settings afterwards. When scanning the repository, TeamCity progressively searches for project files on the two highest levels of the source tree.


1 Answers

  1. Create another build configuration, move your meta-runner there.
  2. Modify your build parameter to report a build number through service message
  3. Create a snapshot dependency from your build configuration to the new one
  4. In the configuration with meta-runner go to general page, enter %dep.META_RUNNER_CONFIG_ID.build.number% to 'build number' field. This will take a build number from the dependency and set it as a build number. META_RUNNER_CONFIG_ID is the Build configuration id you will see on the general page of your configuration where you have moved meta runner.
  5. Use %build.number% as a replacement in AssemblyInfoPatcher
like image 139
Oleg Rybak Avatar answered Oct 22 '22 20:10

Oleg Rybak