5 Replies Latest reply on Aug 5, 2014 11:03 AM by jayshaughnessy

    Automation for bundle management

    swiderski.maciej

      Hi,

       

      I am trying to figure out if there is any out of the box automation capabilities for bundle management. Assuming there is CI server (like jenkins) that build and test projects that should be provisioned to runtime environment via RHQ/JON, I am looking for following capabilities:

      - generate bundles via either some rhq maven plugins or do it "manually" via maven assembly plugin

      - upload generated bundle into the rhq/jon server - maybe via REST api or any other way that is supported

      - schedule deploy operation of given bundle again via some remote service (REST, etc)

       

      First of all, does that sound as a good idea at all?

       

      Next what is already supported in RHQ4.9.0/JON 3.2.0 to fulfill these requirements?

       

      Thanks in advance

      Maciej

        • 1. Re: Automation for bundle management
          tsegismont

          Hi Maciej,

           

          It sounds like a very good idea and a very nice RHQ use case. Automation for the win

           

          There is no Maven plugin to generate bundles but you're right, you can create an assembly file to create the bundle archive (which is just a zip file).

           

          As for the process of uploading/deploying the bundle, I'd recommend you install the RHQ CLI on your Jenkins server:

          1. RHQ CLI Installation - RHQ - Project Documentation Editor
          2. Running the RHQ CLI - RHQ - Project Documentation Editor

           

          Then in a post-build step you could run a CLI script to do whatever you want with your freshly built bundle.

           

          Feel free to ask more questions in this thread if you need more details on the setup or CLI script development.

           

          Regards,

          Thomas

          • 2. Re: Automation for bundle management
            swiderski.maciej

            Thanks Thomas, this is exactly what I did and that works like a charm. One thing that I noticed not directly related with bundle deployment but with purge operation - when bundle is deployed and purge operation is invoked it will actually clean the content on the server (JBoss) but application will be still running. I guess it's related to the JBoss marker files (app.war.deployed) that stays there. Anyway I guess I could include that deployed file into the bundle as well to overcome that issue...

             

            Once again thanks for your thoughts

            Maciej

            • 3. Re: Automation for bundle management
              tsegismont

              Hey Maciej,

               

              I'm glad to hear the bundle automation works nice. As for the deployment scanner issue, did you try to change the value of auto-deploy-zipped ? See Deployment Scanner configuration - JBoss AS 7.1 - Project Documentation Editor

               

              Regards,

              Thomas

              • 4. Re: Automation for bundle management
                swiderski.maciej

                Thomas, the issue was with the archive defined in my recipe that by default extraxts the archive so I changed the exploded=false and now it works like a charm. Application is deployed with scripts and in case purge operation is invoked it removes the content from resources and application servers undeploys the application properly.

                 

                Now it's time to move forward and make use of archive url in the recipe to integrate with nexus to reduce size of the bundles stored in RHQ

                 

                btw is there any way to schedule deploy bundle operation instead of doing it directly?

                 

                Cheers

                • 5. Re: Automation for bundle management
                  jayshaughnessy

                  Hi Maciej,


                  Unfortunately scheduling bundle deployment is still on the list of to-dos.  Via the GUI it is only possibly to schedule deployment for immediate execution.  The best option I know of is to perform the work via scripts (Or a remote client app) and run those scripts via some external scheduling mechanism like cron.  Another approach sometimes useful is to trigger deployments via alerting, using Notifications that run CLI scripts.


                  Regards,

                  Jay