Capistrano for Java?

前端 未结 6 1773
别那么骄傲
别那么骄傲 2021-01-30 07:42

I\'m a big fan of Capistrano but I need to develop an automated deployment script for a Java-only shop. I\'ve looked at Ant and Maven and they don\'t seem to be well geared tow

相关标签:
6条回答
  • 2021-01-30 08:08

    At my work we use Capistrano exclusively to deploy all of our Java applications. It is definitely possible.

    0 讨论(0)
  • 2021-01-30 08:11

    I think that controltier (see: http://controltier.org) is what you are looking for. Though controltier doesn't need to be exclusively used for Java deploys.

    See this excerpt from the docs (see: control tier documentation):

    Is ControlTier the same as Capistrano, Fabric, or Func?

    In their most fundamental concepts, ControlTier, Capistrano, Fabric, and Func are similar tools. We'd definitely call Capistrano, Fabric, and Func basic Command Dispatching Frameworks.

    However, ControlTier, by design, goes far beyond what these other tools provide. The automation libraries and the web-based tools that ControlTier provides are designed to let you build full automation systems ready for use by enterprise or large-scale web operations teams. There are also features like error-handling and centralized logging that just aren't in the scope of other command dispatching tools.

    Also, Capistrano is a Ruby-based tool that is primarily focused on the needs of the Ruby on Rails community. ControlTier, while written in Java, doesn't require you to know Java to use it. In fact, you can use whatever scripting languages you are comfortable with (including ruby). ControlTier attempts to be as language and platform (Linux, Unix, Windows, etc..) neutral as possible.

    0 讨论(0)
  • 2021-01-30 08:15

    I use a capistrano recipe for building dspace (a java webapp, which in turn uses maven) from source : Installing dspace using capistrano

    0 讨论(0)
  • 2021-01-30 08:15

    Capistrano could deploy all the web basic application. Deployments for the different language are almost the same:

    1. update code
    2. push the code to production server
    3. prepare the configuration files for this deployment
    4. restart server. (thin, nginx, tomcat)

    in my company, we use Capistrano to deploy java, Vuejs, php, ruby , python applications.

    0 讨论(0)
  • 2021-01-30 08:22

    What's interesting is that Capistrano's idea of a repo assumes that you're dealing with an SCM (Source Control Manager). The structure on the server and the associated versioning of the application works on the application source. This makes sense for an interpreted language.

    In a compiled language like Java, though, the versioning and branching comes before deployment and by the the time the application is compiled and built, the source control system is already left behind and what results is a versioned jar or tar to contain the application. Typically this tarball (jar + config) is published to a Maven artifact repository like Nexus or Artifactory.

    Surprisingly, this artifact repo maps to the Capistrano repo just fine. In place of the SCM, we can treat this tarball as the SCM (the source to be versioned). With this in mind, I've implemented a Capistrano SCM plugin for Maven artifact repos. It's new but works pretty nicely.

    It unifies our Ruby and Java projects on one tool, and most importantly, it brings the power of Capistrano's SSHKit and rake to our Java projects.

    0 讨论(0)
  • 2021-01-30 08:29

    I don't think there is a Capistrano-like application for Java Web Applications, but that shouldn't really keep you from using it (or alternatives like Fabric) to deploy your applications. As you've already said, Ant is more a replacement for GNU Make while Maven is primary a buildout/dependency-management application.

    Since Java Web Applications are thanks to the .war container less dependent on external libraries, you can (depending on your application server) make deploying an application as easy as running a simple HTTP PUT-request.

    But if you require additional steps, Fabric has worked very well for me so far and I assume that Capistrano also offers generic shell-command, put and get operations. So I wouldn't look for too long for an alternative if what you already have already works :-)

    0 讨论(0)
提交回复
热议问题