Main Content

Magnolia Community Forums: Development: Autodeployment


  • dbaylon
    dbaylon
    Full name: Daniel Baylon
    Posts: 3
    Last post: Aug 23, 2016 11:05:53 AM
    Registered on: Aug 22, 2016
    Autodeployment
    #1 by dbaylon on Aug 22, 2016 1:28:42 PM

    Do you have any strategy to deploy the war file without restarting magnolia and not to install the modules again?

    Thanks!

  • cmeier
    cmeier
    Full name: Christoph Meier
    Posts: 195
    Last post: Apr 18, 2017 5:34:26 AM
    Re: Autodeployment
    #2 by cmeier on Aug 22, 2016 1:45:33 PM

    Hi Daniel

    As far as i know
    whether you can do (or not) WAR hot deployment first depends on your Servlet container, not all servlet containers have this ability.

    Besides that, re-deploying Magnolia Maven modules "usually" requires a Magnolia instance restart.
    However, here it depends on what has changed in the Magnolia module. Some changes require a restart of the Magnolia instance, others don't.
    An instance restart will not re-install the Magnolia modules again - if they already have been installed earlier; but an update may occur, if you have version dependent Module version handler tasks defined.

    What do you want to achieve with the update? What has changed in the modules which you want to redeploy?

    kind regards,
    Christoph

  • dbaylon
    dbaylon
    Full name: Daniel Baylon
    Posts: 3
    Last post: Aug 23, 2016 11:05:53 AM
    Registered on: Aug 22, 2016
    Re: Autodeployment
    #3 by dbaylon on Aug 23, 2016 5:10:53 AM

    Hello Christoph,

    Thank you for this.

    My goal is to deploy the war file (magnolia instance) without restarting/reinstalling the modules again on the new instance.

    Or say for example, I have a new module, can I deploy via cli without restarting/installing the new module?

    Regards,

    Daniel

  • cmeier
    cmeier
    Full name: Christoph Meier
    Posts: 195
    Last post: Apr 18, 2017 5:34:26 AM
    Re: Autodeployment
    #4 by cmeier on Aug 23, 2016 10:02:41 AM

    Hi Daniel

    Once again: What do you want to achieve with the update? What has changed in the modules which you want to redeploy?

    And: Which servlet container / app-server are you suing? Tomcat? JBoss? WebLogic? Websphere? ...

  • dbaylon
    dbaylon
    Full name: Daniel Baylon
    Posts: 3
    Last post: Aug 23, 2016 11:05:53 AM
    Registered on: Aug 22, 2016
    Re: Autodeployment
    #5 by dbaylon on Aug 23, 2016 11:05:53 AM

    Hello Christoph,



    Once again: What do you want to achieve with the update? What has changed in the modules which you want to redeploy?



    Say I just did add new label. Either way, I change something on the code that I rebuild a module. Once I rebuild the module, I build the whole war package for the deployment.



    And: Which servlet container / app-server are you suing? Tomcat? JBoss? WebLogic? Websphere? ...



    I am using Tomcat 7.

    Regards,

    Dan

  • cmeier
    cmeier
    Full name: Christoph Meier
    Posts: 195
    Last post: Apr 18, 2017 5:34:26 AM
    Re: Autodeployment
    #6 by cmeier on Aug 24, 2016 10:20:26 AM

    Dan

    You address a typical Java webapp "issue" - this actually is not specific for Magnolia.

    The WAR file (Web application ARchive) *is* your webapp. If you redeploy the WAR file, the webapp is "down" for a certain time.
    Since a Magnolia instance is a webapplication - e.g. deployed as WAR file - the Magnolia instance is down for a certain time.

    In a productive environment you may have more then one public instance. With such a scenario you can avoid "down time" for the webiste even when redeploying.
    See https://documentation.magnolia-cms.com/display/DOCS/Instances

    While developing with an IDE such as eclipse or intelliJ (and probably even using JRebel) - you won't have to redeploy the complete webapp all the time when adding a label (or whatever).
    (But that's another story.)

    i hope this helps,
    kind regards,
    Christoph

  • runger
    runger
    Full name: Richard Unger
    Posts: 571
    Last post: Feb 1, 2017 9:54:59 AM
    Re: Autodeployment
    #7 by runger on Aug 29, 2016 11:08:51 AM

    Hi Daniel,

    This is a standard problem, and Magnolia provides ways to develop that get around this:

    Basically, if you are developing in Java, then the JVM *needs* to reload your classes when you change them. There are three levels of this:
    1) restart the whole java process (restart tomcat). This will reload everything, but with a lengthy down-time, and lost sessions
    2) tomcat reloads your webapp. Depending on your configuration, it will do this automatically when it detects changes. This has a shorter downtime, but otherwise the same disadvantages as 1). Additionally, most setups will only survive a certain number of reloads before running out of RAM, because tomcat usually doesn't manage to release all the memory the previous instances of the webapp allocated.
    3) hot-code-deploy via your IDE. In the correct setup, while debugging, your IDE can "live-change" some java changes (not all) without restarting anything.

    That all applies for developing in Java.
    If you are are doing so called "light development", not in Java, things can be much more comfortable:

    When you are talking about developing templates, html, javascript, etc... then all you are changing is your resources. Magnolia can detect those changes and reload your resources and definitions automatically, without any need to restart the webapp.

    ***The trick to make this work is to make sure these resources are not part of the webapp, e.g. don't get loaded from the classpath.*** Magnolia provides two mechanisms for your resources outside the classpath:

    1. Light development via filesystem: store your resources on the filesystem (outside the webapp!) and configure the resource base path to point to that folder. Magnolia will find your resources there, and automatically reload them as they change.

    2. Store resources in JCR, in the resources workspace. Again, magnolia will automatically reload them as they change. You can use the webdav module to connect to JCR in a convenient way and thereby edit the files in your favourite editor.

    Hope that helps you!

    Regards from Vienna,

    Richard

You don't have the permission to post on this thread

Sign in

To login on this forum, you can use your Magnolia Forge, Support or Partner account, or, below, your Google, Yahoo! or OpenID account. If you have trouble logging in, or any other sort of issue, please let us know in the Meta forum, on the user-list, or simply by email at forum-admin at magnolia-cms dot com.

* Required

... or sign in with:

  • icon http://{your-openid-url}
  • icon
  • icon https://me.yahoo.com/