Trigger VCS Project Settings update after successfull build

I have a project which settings are versionned in Kotlin DSL format. Let's call this project project A.

I have another project B outside of project A's tree, that contains a build configuration that creates subprojects in projects A i.e.:

  • B's attached VCS is the VCS configured on A as VCS Project Settings. So TC checks out A's project settings on the agent.
  • In a custom agent tool :
  1. Create a kotlin dsl project folder and files depending on parameters (via a custom agent tool)
  2. Run some unit test on the created kotlin dsl files
  3. Commit and push the changes to the VCS

 

Now I would like to automatically ask TC to pull the project settings changes and apply them in project A.

For now I do it manually from the following view: Versionned Settings -> Change Log -> "Check for Changes" button.

Is there a way to trigger it from build B ?

 

I've seen in the manual that line (https://confluence.jetbrains.com/display/TCD10/Storing+Project+Settings+in+Version+Control#StoringProjectSettingsinVersionControl-CommittingCurrentProjectSettingstoVCSForcingSynch):

By default, the VCS trigger will ignore such changes. To enable build triggering on a settings commit,  add a trigger rule in the following format: +:root=Settings_root_id;:*

I did not manage to make it work (I replaced the example with the proper root id).

1
1 comment
Avatar
Permanently deleted user

There is an API endpoint that enables this behaviour.

Commit hooks are received via TeamCity REST API requests which should typically be configured to in the post-commit repository triggers:

POST .../app/rest/vcs-root-instances/commitHookNotification?locator=<vcsRootInstancesLocator>

See this documentation where it is used in combination with commit hooks:
https://confluence.jetbrains.com/display/TCD10/Configuring+VCS+Post-Commit+Hooks+for+TeamCity

0

Please sign in to leave a comment.