Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Using Microsofia-boot to Ease the Deployment Automation

DZone's Guide to

Using Microsofia-boot to Ease the Deployment Automation

Microsofia-boot solves the problem of the JAR artifacts' deployment at the deployment phase and allows us to use the same ecosystem as the development phase.

· DevOps Zone
Free Resource

Download “The DevOps Journey - From Waterfall to Continuous Delivery” to learn learn about the importance of integrating automated testing into the DevOps workflow, brought to you in partnership with Sauce Labs.

In order to achieve continuous integration, one of the several things that should be done is easing deployment automation. 

Let's take the case where we are developing using the Java language and Maven is used as the build system. Once the development phase is done, tests are passed, and the release is done, we have several artifacts with which we want to patch the production: JARs, configuration files, database patches, etc.

Microsofia-boot solves the problem of the JAR artifacts' deployment at the deployment phase just like Maven solves the problem of the JAR dependencies at the development phase.

Simply put, it allows us to use the same ecosystem as the development phase (Maven Artifact repositories, artifacts dependencies) at the deployment phase by just having:

  • One JAR containing all needed dependencies, microsofia-boot.jar.

  • One settings file that has the same structure as the Maven setting.

The deployment phase can then be reduced to the following steps:

  • Once artifacts are released, deploy to the production repository with the new version.

  • Update the version used by the microsofia-boot settings file to the new version.

And that's it! It will download the new versions, build the graph of class loaders, and run your application.

If we prefer not to use a Maven Artifact repository in production, Maven can assemble all of the dependencies so that they can be embedded in an installer. Microsofia-boot can also help here with the offline mode.

Command line usage:

D:\microsofia-boot>d:\java\jdk1.8.0_60\bin\java -jar microsofia-boot.jar -h
usage: boot
 -c,--class <classname>   Class that contains the main to run
 -d,--dump                Dumps the dependency graph to the console
 -h,--help                Prints this help
 -s,--settings <arg>      Settings file path. Default is ./settings.xml
 -t,--template            Dumps a dummy example of settings.xml

Settings file sample:

<settings>
  <!-- Local Maven repository where the artifacts will be downloaded -->
  <localRepository>d:\.m2</localRepository>

  <!-- 
   | Default: false
  <offline>false</offline>
  -->

  <!-- Root artifact that will be used to create the graph of artifacts.
       The graph of artifacts should contain the class that contains the static main 
       method that you want to invoke
   -->
  <dependency>
    <groupId>microsofia</groupId>
    <artifactId>sample</artifactId>
    <version>1.0</version>
  </dependency>

  <!-- List of proxies. Only one should be active -->
  <proxies>
    <proxy>
        <active>true</active>
        <protocol>http</protocol>
        <host>proxy</host>
        <port>1111</port>
    </proxy>
  </proxies>

  <!-- List of mirrors -->
  <mirrors>
     <mirror>
         <id>amirror</id>
         <mirrorOf>centraltt</mirrorOf>
         <url>http://mvenrepomirror/</url>
    </mirror>
  </mirrors>

  <!-- List of repositories -->
  <repositories>
    <repository>
        <id>mvenrepo</id>
        <url>http://mvnrepository</url>
        <releases><enabled>true</enabled></releases>
        <snapshots><enabled>true</enabled></snapshots>
    </repository>
    </repositories>
</settings>

Discover how to optimize your DevOps workflows with our cloud-based automated testing infrastructure, brought to you in partnership with Sauce Labs

Topics:
continuous deployment ,continuous integration ,devops ,microsofia-boot

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}