4.1.2. bundle

Description

Usage

bw bundle BUNDLER DESTINATION FORMAT [DEFINES]

  • BUNDLER is the method used to create the bundle.
  • DESTINATION is any writable directory. The completed bundle will be written to DESTINATION.
  • FORMAT is either ''tgz'' for a Gzipped Tar archive, ''zip'' for a Zip archive, or ''none'' for an uncompressed bundle.
  • DEFINES are optional arguments used by the bundler. The format is: -Dname=value

Ant Usage

<bw.bundle bundler="${bundler}" dest="${dest}" format="tgz" 
      name="${name}" version="${version}">
   <define name="..." value="..." />
   <define name="..." value="..." />
</bw.bundle>

Examples

# Build a tomcat bundle. Bundler will prompt for values.
bw bundle tomcat /home/admin tgz
# Build ruby bundle from source passing the specified options to 'configure'.
bw bundle loadable-source /opt/bundles none \
   -Dsource.dir=ruby-1.8.6 \
   -Dbundle.name=ruby \
   -Dbundle.version=1.8.6 \
   -Dconfigure.options=--enable-pthread
# Use ant version of 'bw bundle' to build custom java application
<bw.bundle bundler="java-service" dest="${dist.dir}/tutorial" 
      format="tgz" name="${bundle.name}" version="${bundle.version}">
   <define name="bundle.dir" value="${basedir}/bundle" />
   <define name="shared.dir" value="${shared.dir}" />
   <define name="java.main" value="org.bundleworks.tutorial.HelloServer" />
   <define name="java.options" 
      value="-Djava.util.logging.config.file=$WORK_DIR/config/logging.properties" />
</bw.bundle>

Notes

  • If FORMAT is either 'zip' or 'tgz', this command creates an archive containing a valid BundleWorks bundle.
  • Bundles created as archives need to be added to bundle inventory with bw add.
  • If FORMAT is 'none', this command creates a bundle as a set of directories within the destination directory and automatically adds it into inventory. The bundle's setup hook is executed in this case.
  • Bundlers that build from source code must have FORMAT set to 'none', as they need to build directly into the destination directory. Binaries built from source often have the build path hardcoded in them, making them difficult, if not impossible, to be moved.
  • You can install a bundle built from source on another machine provided you install into the same directory. In this case, you can create an archive from the bundle directory on one machine and add it as a bundle on the other machine.
  • Bundles can be created manually. However, the 'bw bundle' command is the preferred method of creating a bundle.
  • Information not provided with bundler defines will be prompted.
  • The reference section Bundlers lists all bundlers and their defines.