Automated Deployment solution for multiple Java we

2019-01-30 19:31发布

I'm looking for solutions, preferably open source, that can manage deployments of multiple interdependent java web-applications.

The solution requires an ability to create and store a release specification containing multiple items for release - specific versions of each application and relevant other artifacts (database config, apache config etc.).

The specification then needs to be parsed and each item then need to be deployed/executed on a target environment. Target environment is linux based. Web-apps are vanilla wars running on a j2ee standard app server.

A lot to ask?

Currently I think all the bits are in place - the binary artifacts are released with the maven release plugin and hence available from our maven repo for deployment, the database is versioned with dbdeploy and the apache config is versioned in svn. However I don't know of any tool that can put all these steps together on multiple applications.

My current preferred approach is to use a form of a parameterised build for hudson to create the specification. Then a second parameterised build to select a pre-created specification and deploy/execute it on a chosen environment.

However this seems to be a lot of work and a less than optimal custom solution.

Anyone know any prebuilt better ideas? or suggestions for for how to approach this - maybe a workflow engine would be better than hudson? maybe a custom web app?

Notes:

The target environments are prebuilt with all requirements in place - e.g. java and app server installed, database running etc. This is less of an environment configuration question and more of a deployment question.

Automating deployment of single apps is a problem with many solutions e.g. cargo, ant deployment scripts etc. However I need something that can wrap multiple deployments. E.g. kick off cargo on specific versions of multiple apps and their requirements.

9条回答
Ridiculous、
2楼-- · 2019-01-30 20:10

Sounds like you need a chef to cook your configuration :)

查看更多
The star\"
3楼-- · 2019-01-30 20:16

My suggestion is to use a combination of tools (separation of concerns, the right tool for the right problem) that will help you to accomplish your objective, let me mention some of the ones that I've used:

in addition to the tools mentioned above, there are other that can be helpful and you can use them according to your project needs: http://www.oracle.com/technetwork/articles/java/deployment-tools-2227133.html

Now talking about the problem. The first thing that I noticed is that you mentioned that you already have your release artifacts in your repository manager (like Artifactory), so the next step that we need to do is a way to orchestrate the deployment of these artifacts at the same time, I think one option is to use the Paremeterized Build (https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Build, where you need to define multiple parameters that will contain the different versions of the artifacts that you want to deploy, once the user fills these values we will use them to pass as parameters to a rundeck job (rundeck is a tool that helps you to orchestrate tasks in different nodes), this rundeck deployment master job will receive the parameters and will orchestrate the deployment of your artifacts. Some examples of the steps that a rundeck job will contain are: Stop your Container, Backup your current Components, Start your Container, Download your artifacts from your repository manager, Create Resources in your Container, Deploy your components in your container, Execute your DB Deploy, Send an email if the process fails, etc .. Usually each of these steps are sub-jobs (that also receive parameters), and at the end we create one master job that uses/orchestrate all these sub-jobs.

Let me add some images examples of this type of CD process. This example is only deploying War/Ear artifacts, but it can help you to see the big picture:

https://drive.google.com/folderview?id=0B-FVAopZZjDWdGl0WlNjX1RnRDQ&usp=sharing

I hope this can be helpful.

查看更多
兄弟一词,经得起流年.
4楼-- · 2019-01-30 20:19

glu seems to be a very nice choice for automating deployments. Description from its web site:

What is glu?

glu is a free/open source deployment and monitoring automation platform.

What problems does glu solve?

glu is solving the following problems:

  • deploy (and monitor) applications to an arbitrary large set of nodes:
    • efficiently
    • with minimum/no human interaction
    • securely
    • in a reproducible manner
  • ensure consistency over time (prevent drifting)
  • detect and troubleshoot quickly when problems arise

How does it work?

glu takes a very declarative approach, in which you describe/model what you want, and glu can then:

  • compute the set of actions to deploy/upgrade your applications
  • ensure that it remains consistent over time
  • detect and alert you when there is a mismatch

It is maintained by Yan Pujante and originated at LinkedIn which used it in-house.

查看更多
The star\"
5楼-- · 2019-01-30 20:19

Since this old thread comes up first on google search I want to add a new alternative:

Ansible executes commands over SSH and it is very easy to setup and use. It only takes a few hours to understand the concepts and start writing your own tasks.

Excerpt from site:

In addition to not requiring any daemons or bootstrapping, Ansible's Playbook language is the simplest systems management language out there. It reads like English. We believe you have other work to do, so we want you to get things done quickly and get out of your way.

查看更多
来,给爷笑一个
6楼-- · 2019-01-30 20:25

Deployment is a complicated business. Maven has many of the plugins you could need to manage a deployment, but it takes some configuration to get it to do exactly what you want. The following describes how each of your issues could be addressed. Though depending on your environment, it might be more trouble than it's worth.

The maven Cargo plugin can be used to deploy the applications. Obviously this can be quite involved but Cargo is a pretty good tool for managing deployments.

The apache config could be packaged as a separate jar by your build process and deployed to the repository, then downloaded/published for use in your deployment jar (the dependency plugin can be used to pull the config jar from the repository). Alternatively Maven has an scm api that can be used to invoke arbitrary commands against your SCM repository (see this answer for an example plugin using the SCM API.

As far as I know there isn't a Maven plugin for dbdeploy, but this blog post shows how the maven-antrun-plugin can be used to script the deployment.

查看更多
甜甜的少女心
7楼-- · 2019-01-30 20:28

I've very similar requirements. Focusing on application deployments instead of environment deployments, seems that http://www.kwatee.net/product perfectly fits!

  • Web interface to create/configure and control the deployments
  • Multi-platform deployment support
  • Version management, incremental updates deployments
  • Use plan shell commands when required
  • Lightweight & easy to use understand and manage
查看更多
登录 后发表回答