Restart Agent mid build

Answered

Hello, I am new to TeamCity and i am curios if it is possible during the middle of a pipeline to restart the agent (install software which requires a reboot) and when the agent is back online, the pipeline to resume where it left off and finish ? I would rather not use multiple pipelines, have it in just one go. Thanks. 

0
5 comments
Avatar
Fedor Rumyantsev

Hello Alexandru,

This likely would not be possible (at least, in a reliable manner). Could you please describe your use case so I could by chance suggest something? 

0
Avatar
Permanently deleted user

The idea is that for a testing pipeline, the generated installer would be grabbed from a third party source ( problem solved ) , i then have to install the product on a machine, but the installation requires a restart of the machine, after the restart is done, begin the testing procedures.

0
Avatar
Fedor Rumyantsev

I see, thank you! I believe that in order for it to work in TeamCity some separation between the test environment and agent process would be required. Would it be possible for you to run a VM or container so to run the installer there and handle the restart as part of the custom script on the agent side? (for the container, you would probably want to mount an external folder so not to lose the container state after installation)

0
Avatar
Permanently deleted user

Unfortunately the VM or container would not work since the tests need to use the actual hardware to run the tests, which cannot be emulated.

0
Avatar
Fedor Rumyantsev

Alternatively, you may use agent so to remote into a physical machine and run the installer/restart sequence. I have mentioned the virtual instances just because that would be an easier option for the regular test run (with no need to cleanup afterwards, that is) but the same principle would apply to the physical machine as long as agent is running elsewhere.

0

Please sign in to leave a comment.