Create a deployment package containing your local store using the WCB tool

In this lesson, you create the deployment package containing your local store using the WCB tool. This package can then be used to create custom Docker images for use in a live production environment. For more information on packaging customized code for deployment, see Packaging customized code for deployment.

Before you begin

  • Create a backup of the WC_installdir/WCBD/ directory within your HCL Commerce development environment.
  • Ensure that you use the forward slash (/) character as the file separator.
  • If your customizations depends on any third-party libraries, ensure that they are included in WAS_HOME/lib/ directory.
Note: This task uses the following conventions:
  • Application specific scripts or property files are distinguished by application type. In the following steps, apptype stands for the application type that is currently being built. Accepted values can be ts, crs, search, xc, or data. Because we are building the local store package into the Transaction server, the apptype for this tutorial task is ts.
  • In the following steps, scm refers to the method by which the source code is extracted. The scm can be local, or any supported source code management type. Accepted values can be cvs, svn, or git. For the purposes of this tutorial task, we assume all of your source code is available on the local file system, so scm is local.

Procedure

  1. Configure your build environment.
    1. Create a directory on your local file system that will be used as the source code directory for the WCB build process.
      For example, create C:\source\.
    2. Create a subdirectory to contain the HCL Commerce projects that you want to build.
      For example, create C:\source\workspace\.
    3. Copy your store project into the projects subdirectory.
      For example, copy the WCDE_installdir/workspace/Stores/ directory into C:\source\workspace\.
    4. Optional: If you have other customizations that you have made to the Transaction server, you must also copy these into the projects subdirectory to be built with the ts deployment package.
      For example, this could include any customizations in the WebSphereCommerceServerExtensionsData or WebSphereCommerceServerExtensionsLogic projects.
  2. Configure the WCB tool to extract your Transaction server local store and other customization source files.
    1. Copy the wcbd-sample-extract-local.properties sample WCB configuration file into your WCB directory.
      For example, copy WCB_installdir/extract/wcbd-sample-extract-local.properties into WCB_installdir/extract-local-ts.properties.
      Note: The naming convention of this configuration file is important: local is the keyword to indicate that the source code is on local file system, and ts is the keyword to indicate that the application type being extracted for is the Transaction server.
    2. Edit the WCB extraction configuration file to point to the directory you created in step #1.
      1. Open the WCB_installdir/extract-local-ts.properties WCB configuration file for editing.
      2. Set local.extract.dir to be your local source code directory. For example, using the directory we used in step #1.a:
        local.extract.dir=C:/source
      3. Save and close the file.
    3. Copy the wcbd-sample-extract-local.xml sample WCB configuration file into your WCB directory.
      For example, copy WCB_installdir/extract/wcbd-sample-extract-local.xml into WCB_installdir/extract-local.properties.
    4. Edit the extract-local.properties WCB extraction configuration file.
      1. Open the extract-local.properties WCB extraction configuration file for editing.
      2. Change the project name from wcbd-sample-extract-local to extract-local.
        <project name="extract-local" default="all">
      3. Save and close the file.
  3. Configure the WCB tool to build and package your Transaction server local store and customizations.
    1. Copy the wcbd-build.properties.template sample WCB configuration file into your WCB directory.
      For example, copy WCB_installdir/wcbd-build.properties.template into WCB_installdir/wcbd-build-local-ts.properties.
      Note: The naming convention of this configuration file is important: local is the keyword to indicate that the source code is on local file system, and ts is the keyword to indicate that the application type being built for is the Transaction server.
    2. Edit the wcbd-build-local-ts.properties WCB build configuration file.
      1. Ensure that the following configuration properties are updated to reflect your specific build environment, and deployment package build requirements.
        wc.home=<commerce developer install directory, e.g c:/WCDE_V9>
        was.home=<WebSphere Application Server home, e.g c:/IBM/WebSphere/AppServer>
        extract.ant.file=${basedir}/extract-local.xml
        run.package.server=true
        run.package.toolkit=false
        web.module.list=Stores #add more web modules into this list if required, separated by commas
      2. Optional: Modify any other properties based on the customization code you included, your build environment, and your database. For example, if you have any EJB code in WebSphereCommerceServerExtensionsData, you should set the following property.
        ejb.module.list=WebSphereCommerceServerExtensionsData
      3. Save and close the file.
    3. Enable your WCB tool to handle sensitive data.

      Create a copy of the wcbd-build.private.properties.template sample WCB sensitive data properties file in your WCB directory. For example, make a copy of the WCB_installdir/wcbd-build.private.properties.template file, and rename it to be build-local-ts.private.properties.

      Note: The naming convention of this configuration file is important: local is the keyword to indicate that the source code is on local file system, and ts is the keyword to indicate that the application type being built for is the Transaction server.

      No changes are required to be made to this file. The WCB tool will use this file to store sensitive data in an encrypted format.

    4. Configure your WCB tool build environment variables.
      1. Create a copy of the wcbd-setenv.bat.template sample environment configuration utility script in your WCB directory. For example, make a copy of the WCB_installdir/wcbd-setenv.bat.template environment configuration utility script, and rename it to be setenv.bat.
      2. Open the setenv.bat environment configuration utility script for editing.
      3. Set the following environment variables for your environment.
        ANT_HOME=<Directory contains ant binary, e.g C:/WCDE_V9/wcbd/apache-ant-1.10.1>
        WAS_HOME=<WebSphere Application Server home, e.g C:/IBM/WebSphere/AppServer>
        WC_HOME=<Commerce Developer installation directory, e.g C:/WCDE_V9>
        
      4. Save and close the file.
  4. Run the WCB tool to build your deployment package containing your local store.
    1. In a command prompt, navigate to the WCB_installdir directory.
    2. Run the following command to build the Transaction server package.
      wcbd-ant.bat -Dapp.type=ts -Dbuild.type=local -buildfile wcbd-build.xml -Dbuild.label=V9

      The app type and build type correspond with the package type we are creating, and the source code source that we have configured for this environment. The build label, V9, is used to identify the specific build, and can be customized each time the utility is run.

Results

Your local store is built into an HCL Commerce version 9 Transaction server deployment package. The package, if built with the V9 build label, can be located at WCB_installdir/dist/server/wcbd-deploy-server-local-ts-V9.zip.

What to do next

This Transaction server deployment package can now be used to create Transaction server and web server Docker images that can then be deployed within a production environment.

To continue with the tutorial, proceed to Create custom ts-app and ts-web Docker images.