2

In continuous deployment world, rollback is a tough topic.

I need to rollback to my latest version.

I use Hudson and Maven, and I want to deploy to a Java EE application server like JBOSS.

Eg.

<build>
    [...]
    <plugins>
        <plugin>
            <groupId>org.jboss.as.plugins</groupId>
            <artifactId>jboss-as-maven-plugin</artifactId>
            <version>7.6.Final</version>
        </plugin>
    </plugins>
</build>

Any idea?

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
giusy
  • 365
  • 2
  • 5
  • 17
  • Rollback can be tough, right. It's even tougher to have an idea without knowing a bit more about your environment than the tools you use and a single plugin section. – Gerold Broser Oct 17 '14 at 23:28

1 Answers1

4

It depends from the technology and from the CD tool used.

For instance, Weblogic has the option to mark the replaced package as "retitred" and to reactivate it.

mvn  com.oracle.weblogic:weblogic-maven-plugin:redeploy  
    -Dadminurl=t3://myhost:7001 -Duser=weblogic -Dpassword=mypassword 
    -Dtargets=AdminServer -Dname=sample.war

but the version (in the Manifest) must be different.

Generaly speaking when you build an application you will assign a version number, then you can restore the latest version storing the history of your versions.

In your case (Hudson-CI with Maven) you may use a DB (MySQL of MantisBG in my case) to store the version of the packages just released, then you are able to rollback easily.

A little explaination can be found here Maven Build Cuistomization.

Sometime, we do not deploy only one application but several packages with a "Parent Version":

  • MyProject Release 1.0.1
    • MyApp.ear 1.3
    • MyBatch.jar 2.0

then you need a more complex CD system; in my case I use the hierarchy proposed by my Bug Tracker (MantisBT), but there are a lot of tools more professional see also Continuous Delivery Scenario - implementing Rollback

Community
  • 1
  • 1
venergiac
  • 7,469
  • 2
  • 48
  • 70