Rob
Rob

Reputation: 11733

Best Way to Remote Deploy to Tomcat on EC2

I have been using Jenkins and it's really a drag. Jenkins is great as a build server, but for deploys, it often doesn't work, but worse, ends up hanging quite a lot.

Heroku and the like are really appealing because I would like to just do a git push.

Perhaps there are ways to support remote deploy through a jenkins plugin?

My build machine is a mac mini.

Upvotes: 0

Views: 433

Answers (3)

Kevin Willock
Kevin Willock

Reputation: 1958

You could always leverage a release tool like webistrano to do your deploys. We often use webistrano or Capistrano to do our deploys, and then Jenkins to sanity test it after

Upvotes: 1

chubbsondubs
chubbsondubs

Reputation: 38857

My personal preference is just to write an Ant script for this purpose. There are several tasks that make it fairly easy. The scp, sshexec tasks are best. But, keep in mind that sshexec doesn't start a shell! It just executes a command so you don't have a current working directory, environment variables, no variable substitution, etc that the shell provides you. You CAN use this trick to pass variables from your client to the server doing something like this:

How to use SSH to run a shell script on a remote machine?

That helps with keeping your script somewhat environment/machine neutral. So use scp to push your package up to the server, then use sshcommand to deploy it with a unix script to copy it out, restart tomcat, etc.

Upvotes: 0

Yair Zaslavsky
Yair Zaslavsky

Reputation: 4137

I consider myself quite novice with Jenkins,
but assuming you can write your own scripts (and I know you can), And assuming EC2 has deployment API, why can't you write a simple script that will do that for you, once build is successful?
What about using OpenShift? I think they have a PaaS configuration with tomcat - can that help you in any way to perform the task needed?

Upvotes: 0

Related Questions