问题
Could Teamcity control application deploy, for example to tomcat?
P.S. without plugins like this
回答1:
We implemented similar tasks with Teamcity to deploy war files to our jetty servers:
After the ordinary build step that creates the war file, we invoke a script in a "Command Line" build step which uses scp to copy the war file to the jetty server.
On the jetty server, there is a cron job running at every five minutes just checking if there is a new war file or not. If there is, it shutdowns down jetty server, backs up the existing war file and put the new war file, then start up jetty server again.
One drawback of the solution above is that after Teamcity build finishes, we always need to wait some time until the cron job kicks in and redeploys the war.
There is a slightly different approach, which can deploy war file in the Teamcity build process:
Instead of using a cron job to invoke the deployment script, it can be invoked from that "Command Line" build step also, by something like following, after "scp" finishes copying the war file.
ssh -t user@server: "path_to_the_deployment_script"
We have never tried the second approach yet, theoretically it should work.
来源:https://stackoverflow.com/questions/15591078/teamcity-control-application-deploy