Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

setup trigger for file change in teamcity

I can setup teamcity trigger to run tests whenever there in VCS checkin/ change.

Then I setup command line build steps to access files on system .

e.g. `custom script'

cd ~/Desktop
ls

But is there way to trigger test run if there is change in file e.g. test.txt

I want to setup trigger as 'if file changes run tests'.

Or it has to be git checkin?

like image 524
user2661518 Avatar asked Oct 18 '25 10:10

user2661518


2 Answers

You would add a new "VCS Trigger" under your project configuration and you would add a new "Trigger rules" specifying the file/directory that should trigger the build. For example: +:root=ContecIT:ContecRepairSystem/** (here I am saying monitor the VCS root "ContecIT", and watch for any files changes under the "ContecRepairSystem" directory.

like image 63
Ben Richards Avatar answered Oct 21 '25 09:10

Ben Richards


I'm not aware of any "FileSystemWatcher" feature in TC for triggering builds, unfortunately. Sounds like a good idea for a new TC plugin.

I've checked (here) if perhaps there's such a plugin already. Seems not. The "Url Build Trigger" comes closest. You could try to fork and adjust it to suit your needs.

I think your use case is quite rare. Usually a TC farm comprises many TC agents, each running on a different machine. Thus, they can't monitor the same filesystem (e.g. the Desktop directory), except perhaps some shared folders...

like image 29
sferencik Avatar answered Oct 21 '25 07:10

sferencik