0 Replies Latest reply on May 1, 2014 11:58 AM by Matias Fernandez

    How can I make an atomic deployment (replace) on JBoss AS 7

    Matias Fernandez Newbie

      Hi all, I'm working on a fully automated deployment process using JBoss AS CLI. I have the requirement of make an atomic deployment of an existent application. I define the process this way:


      1. There is a JBoss AS running with 1.0 version of a web application deployed and enabled (app.war version 1.0)
      2. An automated process start a deployment of 2.0 version of the same webapp (app.war version 2.0)
      3. The new deployment fail because the war file is wrong (for example if it lacks of some Class, or for any reason it couldn't start)
      4. The expected result is to have 1.0 version of the application running again, so nothing happens. It's like a rollback of the deployment process.


      I made some tests of deployment using the CLI and I couldn't achieve that kind of behavior. My tests were:


      Make an standard deployment:


      [ having app.war version 1.0 deployed with name=app.war runtime-name=app.war ]


      > deploy new\app.war


      Result: The original application was undeploy, the new deployment failed so at the end there's none application running.


      Run a CLI Batch:


      [ having app.war version 1.0 deployed with name=app-1.0.war runtime-name=app.war ]


      > batch

      #> undeploy name=app-1.0.war --keep-content

      #> deploy new\app.war --name=app-2.0.war --runtime-name=app.war

      #> undeploy name=app-1.0.war

      #> run-batch


      Result: The batch ended successfully. The new war file was uploaded but never enabled, so the deployment didn't fail. But again, there's none application running at the end of the process.


      My tests were on a standalone JBoss AS, but I have to make this process for domain mode also, because we probably will use that mode in production.


      Thanks for you help!