Skip to content
forked from t1/deployer

Deploy artifacts from Artifactory to JBoss AS

Notifications You must be signed in to change notification settings

derzufall/deployer

 
 

Repository files navigation

The Deployer Join the chat at https://gitter.im/t1/deployer Download Quality Gate

Simple Infrastructure As Code solution for Java EE containers (currently only JBoss 7+) pulling from a maven repository (currently full support only for Maven Central and Artifactory Pro, as we need to be able to search by checksum).

Motivation

There are very good IaC solutions capable of deploying applications to and configuring resources in JEE containers. There's good support for Wildfly in Ansible, Salt, and Puppet (to name just a few). They are very powerful and can do much more than just this; e.g., they can install the JBoss itself. And that's exactly the problem that I had: Great power comes with great responsibility... too much responsibility for me as a simple developer and operator of JEE applications, working in an environment where the infrastructure and platform is managed by dedicated operations teams, using those other IaC tools.

As a JEE developer, it also takes some time and dedication to learn those tools... and even more so to add to them. I'd rather have a very limited tool, that's easy to understand and does only what I want it to do... living in the environment I know best: JEE.

And this simplicity also brings some security, I suppose. A central instance that can mess with any aspect of my system is a real honey pot to any attacker.

OTOH, The Deployer tries to keep away from container specifics, so the configuration files you'll write should run on any JEE container The Deployer supports. I must admit that this is rather academic at the moment, given that only JBoss 7+ is currently supported, but it may prove worth trying to keep adaptability in mind.

Configuration quickly grows unwieldy. So it's all about reducing it to the essential, driving repetition out.

1-Minute-Tutorial

  • Create a file $JBOSS_CONFIG_DIR/deployer.root.bundle containing:
deployments:
  jolokia:
    groupId: org.jolokia
    artifact-id: jolokia-war
    version: 1.3.2
  • Deploy the deployer.war to your container. On startup, it will find your file, pull jolokia from maven central, and deploy it to the container.

  • Change the file to version 1.3.3 and the deployer will pick up the change and upgrade jolokia.

Documentation

You can find an introduction to the concepts and best practices in the tutorial.

For a comprehensive list of all details, see the reference.

More questions? Take a look at the FAQ.

Docker

At first sight, it may look like The Deployer would not have any role to play when you use Docker, as in a fully containerized approach, there's no need to change a running system: changes in the configuration should result in a rebuild and restart of the whole stack and it's sufficiently easy to use the normal CLI for that.

But you may find the abstraction layer that The Deployer provides to be useful nonetheless: A bundle file may be more readable than a long list of CLI statements, as it is more concise and clear (e.g., xa and non-xa data sources both use the same connection uri syntax), and it provides mechanics to reuse common configuration schemes, further DRYing your infrastructure code.

You won't want to download and apply everything at boot time, as this happens very often in a dynamic cloud setup, so it has to be as fast as possible. To apply The Deployer root bundle at Docker build time, you can start the container from your Dockerfile with the shutdown-after-boot option in your deployer.config.yaml. For an example, see src/main/docker/Dockerfile; to run it do:

cp ../../../target/deployer.war .
docker build --tag=wildfly .
docker run -it --rm -p 8080:8080 --name wildfly wildfly

To use it for your own applications, you'd only need to change the deployer.root.bundle, and maybe configure your repository in the deployer.config.yaml.

Starting up a container when building an image is not very fast, so to speed things up, we'd like to implement an offline mode.

Building

Just run mvn clean install.

If you don't have an Artifactory Pro on your local machine, but still want to test deployments of your own applications, you can run the ArtifactoryMockLauncher and run index in its CLI. This will build an index of every war, ear, bundle, and postgresql-jar in your local maven repository (~/.m2) and serve files from there.

Release Notes

See the closed milestones

We use Semantic Versioning.

Plans

See the open milestones and issues.

Contribute

You can join the chat or feel free to simply open issues. Pull requests are also welcome.

License: Apache 2.0

Get more details at codescene.io.

About

Deploy artifacts from Artifactory to JBoss AS

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 97.1%
  • Shell 2.5%
  • HTML 0.4%