Cargo
  1. Cargo
  2. CARGO-457

Add Packager API to packager a container's distribution, a Configuration and deployed Deployables

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.8
    • Fix Version/s: 0.9
    • Component/s: Core
    • Labels:
      None
    • Complexity:
      Intermediate
    • Number of attachments :
      0

      Description

      From a mail sent to the dev list:

      Hi,
      
      I'd like to propose introducing a new API in Cargo: the Packager API. The idea is that it would be useful for our users to ask Cargo to give them a consolidated distribution containing the container distribution files, a container configuration and deployed deployables.
      
      For example this would be very useful for the use case where a user wants to use Cargo to generate an application (i.e. a container, its configuration and deployed deployables).
      
      I'm thus proposing the introduction of the following interface:
      
      /**
       * Gathers an installed container distribution and a local configuration in a single location.
       * There can be several packagers like a directory packager which packeg them in a given directory
       * on the file system, a ZIP packager which does the same but packaged as a ZIP file, etc.
       *
       * @version $Id: Container.java 886 2006-02-28 12:40:47Z vmassol $  */ public interface Packager {
          /**
           * Package an installed container distribution and its local configuration in a single location.
           *
           * @param container the installed container to package
           */
          void packageContainer(InstalledLocalContainer container); }
      
      This interface will be implemented by the different containers.
      
      We would also add a PackagerFactory class to return a packager for a given container.
      
      There could be several packager types (directory packager, zip packager, IzPack packager, etc). Thus we would also introduce a PackagerType class and use it to register packagers in the DefaultPackagerFactory class.
      
      Last, I'd like to introduce a new Maven2 MOJO so that users can type "mvn cargo:package". This would also mean the introduction a some new configuration elements:
      
      <configuration>
        <container/>
        <configuration/>
        <deployer/>
        <packager>
          <type>directory|zip|...</type>
        </packager>
      </configuration>
      
      The "directory" type would be the default so no configuration element would need to be specified to use it.
      
      WDYT?
      
      Thanks
      -Vincent
      

        Issue Links

          Activity

          Hide
          Vincent Massol added a comment -
          • Core APIs are in there
          • A first implementation for Tomcat is there to prove it works
          • Some functional tests are there too

          We need to open new issues for implementing packagers for the other containers. This is a good way for users to contribute to Cargo...

          Show
          Vincent Massol added a comment - Core APIs are in there A first implementation for Tomcat is there to prove it works Some functional tests are there too We need to open new issues for implementing packagers for the other containers. This is a good way for users to contribute to Cargo...

            People

            • Assignee:
              Vincent Massol
              Reporter:
              Vincent Massol
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: