How can I redeploy a plugin during development without restarting TeamCity?

I am new to plugin development, so, I am wondering what is the best plugin development workflow? At the moment, I have an Ant goal, which creates a zip file and copies it to the TC data path plugins directory. When I change something, I have to stop TC, redeploy the zip and restart TC.

Is this the best form of plugin development?
Am I able to redeploy the plugin without restarting TC?
Is it possible to eliminate the Ant phase and deploy the plugin from within IDEA Ultimate?

6 comments
Comment actions Permalink

TeamCity cannot reload your plugin completely, without server restart.

However, if you start TeamCity with additional system property: -Dteamcity.development.mode=true it will automatically update plugin resources (JSP, JS files). So if you change a JSP and publish new plugin TeamCity will pickup this change without restart. If your plugin has agent specific code, this part should be picked up too, and agent should upgrade automatically and start using updated agent part.

I would also recommend to add Java debug parameters to TeamCity server: -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=<some port number>
In this case you will be able to connect to TeamCity, debug your code, and make a HotSwap if change is small.

0
Comment actions Permalink

Hi Pavel,

thank you for your answer. The development mode hint is very useful.

Regarding HotSwap and redeployment: In my other Spring web-projects I am using JRebel to reload changes on the fly. Have you made experience in TC plugin development with JRebel? Any recommendations? Otherwise, I will try to create a compatible rebel.xml.

0
Comment actions Permalink

No, we did not try JRebel internally, it would be interesting to hear your experience, if you'll try it.

0
Comment actions Permalink

Great news! It is possible to use JRebel with TeamCity plugin development. This is great! After code changes, JRebel reloads the classes without TC restart.

I wrote a small blog entry for this: http://blog.timomeinen.de/2011/10/use-jrebel-to-develop-teamcity-plugins-with-more-speed-and-fun/

Try it. It saves a lot of time.

0
Comment actions Permalink

Great! Thank you for discovering this possibility!

0
Comment actions Permalink

Hello,

I have the same need, but I don't have JRebel. I have been looking at hotswapagent (http://hotswapagent.org/), which looks promising, but I couldn't get it to work. I tried to use the modified JVM and start the server with the agent:

export CATALINA_OPTS="-javaagent:hotswap-agent-1.1.0-SNAPSHOT.jar"

But the server doesn't start successfully, it seems to start an endless restart loop. I am pretty new to this kind of technique, so it would be great if someone could give me hand.

If it works, I think it should be part of the official documentation, because the restarting the server is very time-consuming and probably demotivates some people to develop plugins.

 

0

Please sign in to leave a comment.