Auto deploy jenkins 1.5.x job build to Jboss7.2

3.4k views Asked by At

I'm trying to configure Jenkins such that after the job it should copy the last stable build (war) to the jboss deployment directory. I've tried the Artifact Deployer Plugin but I'm not sure what value to fill in the "Files to deploy" field.

Any one has any idea or other way to do the deployment? Jenkins and Jboss run on the same machine but different user (jenkins and jboss) respectively.

Thanks.

1

There are 1 answers

3
coffeebreaks On

This question of how to deploy to a local jboss 7 was already asked and answered: How to deploy a war file in JBoss AS 7?

Basically you will have to either configure jboss to deploy automatically or play with trigger files. You probably want to ensure the app is fully deployed before you do your next step (e.g. search for $artifact.deployed files if you use the copy technique to deploy).

Still the main question is

do you put this scripting bit directly inside jenkins or inside your code repository ?

In the second option, you leave only the configuration (target hosts, directories path, etc) inside your jenkins job. I personally like to have the ability to perform the tasks outside of jenkins as well as it eases troubleshooting.

As for the script and copying tasks, if you don't want to manage this yourself, and if you would rather use a third party tool to handle this for you, you might want to look into cargo.

The latest cargo (1.4.3) supports jboss 7.2 out of the box, for local and remote deployments as well. This would allow you to support deploying to remote servers as well in the future.

You can use cargo:

  1. from ant/maven/gradle/etc (How can I make Jenkins deploy my project to JBoss EAP(AS7))
  2. or directly from the jenkins Deploy Plugin plugin as well. The current latest version of the jenkins Deploy Plugin doesn't use the latest cargo, and it seems that jboss 7 support was added in 1.4.3, so you might need to patch it and bump the cargo.version number in the jenkins plugin.

I would go for a solution with some scripting with ant/maven or whatever is your current build tool, either for local file copying or using latest cargo for flexibility.