Feature Pack 7 or later

Deploying the customization

In this lesson, you are deploying your customization. You can package and deploy your Profit Margin tutorial related customization into your production environment with the WebSphere Commerce Build and Deployment tool.

Procedure

  1. Copy the Store and Search deployment packages to the production environment and extract them to WCBD_deploy_server_wc_dir and WCBD_deploy_server_solr_dir directories.
  2. For each of the deployment packages, configure the server deployment settings.
    1. Go to the package directory. For example, WCBD_deploy_server_wc_dir, and then WCBD_deploy_server_solr_dir.
    2. Copy the contents from:
      • wcbd-deploy.properties.template to deploy-profit_margin_wc.properties and deploy-profit_margin_solr.properties.
      • wcbd-deploy.private.properties.template to deploy-profit_margin_wc.private.properties and deploy-profit_margin_solr.private.properties.
      • wcbd-setenv.bat.template to setenv.bat.
    3. Open the setenv.bat file. Modify the ANT_HOME and WAS_HOME environmental properties to the correct values. For example:
      
      ANT_HOME=C:\apache-ant-1.8.2
      WAS_HOME=C:\WebSphere\AppServer
      
    4. Open the deploy-profit_margin_wc.properties and deploy-profit_margin_solr. properties files. Set the following properties according to the configuration of your subordinate server.
      Note: : If necessary, see WC_installdir/instances/instance_name/properties/createInstance.properties and WAS_installdir/profiles/WAS_profile_name/properties/portdef.props to obtain the correct values for your configuration.
      For Stores:
      
      existing.web.module.list= Stores
      wc.home=WC_home (e.g. C:/WebSphere/CommerceServer70)
      wc.instance.name=WC_instance_name (e.g. demo)
      was.home=WAS_home (e.g. C:/WebSphere/AppServer)
      was.profile.name=WAS_profile_name (e.g. demo)
      was.host.list=Host name of the machine where deployment is to be performed
      was.port=WAS_SOAP_port (e.g. 9066)
      was.jvm.max.memory=1024M
      db.type=db2
      db.name=DB_name (e.g. mall)
      db.schema.name=DB_schema (e.g. the database user name)
      jdbc.url=DB_JDBC_URL (e.g. jdbc:db2://<hostname>.com:50000/mall)
      jdbc.driver=com.ibm.db2.jcc.DB2Driver
      jdbc.driver.path=DB_JDBC_Driver (e.g. C:/WebSphere/SQLLIB/java/db2jcc4.jar;C:/WebSphere/SQLLIB/java/db2jcc_license_cu.jar)
      datasource.jndi.name=jdbc/WebSphere Commerce DB2 DataSource ${wc.instance.name}
      static.web.deploy=false
      run.wc.server.sync=false
      dataload.dataload.common.ordered.list=the dataload task your are going to perform. 
                 All of the dataload folders under ${source_dir}\dataload\dataload\common need to be added in this list 
                 (e.g. dataload_price_list/wc-dataload.xml,dataload_cost_price/wc-dataload.xml)
      
      For Search:
      
      existing.web.module.list=Search-Rest
      wc.home=WC_home (e.g. C:/WebSphere/CommerceServer70)
      wc.instance.name=WC_instance_name (e.g. demo)
      was.home=WAS_home (e.g. C:/WebSphere/AppServer)
      was.profile.name=WAS_profile_name (e.g. demo_solr)
      was.host.list=Host name of the machine where deployment is to be performed
      was.port=WAS_SOAP_port (e.g. 8881)
      was.jvm.max.memory=1024M
      db.type=db2
      db.name=DB_name (e.g. mall)
      db.schema.name=DB_schema (e.g. the database user name)
      jdbc.url=DB_JDBC_URL (e.g. jdbc:db2://<hostname>.com:50000/mall)
      jdbc.driver=com.ibm.db2.jcc.DB2Driver
      jdbc.driver.path=DB_JDBC_Driver (e.g. C:/WebSphere/SQLLIB/java/db2jcc4.jar;C:/WebSphere/SQLLIB/java/db2jcc_license_cu.jar)
      datasource.jndi.name=jdbc/WebSphere Commerce DB2 DataSource ${wc.instance.name}
      static.web.deploy=false
      run.wc.server.sync=false
      
    5. Append the following properties used for deploying the WebSphere Commerce search customization. In the section at the bottom of the file used specifically for customization, insert the following snippet.
      Note: Verify that these values are correct for your environment.
      
      solr.home=${wc.home}/instances/${wc.instance.name}/search/solr/home
      solr.preprocess.dir=${wc.home}/instances/${wc.instance.name}/search/pre-processConfig
      master.catalog=10001
      solr.locale=en_US
      solr.profile=${wc.instance.name}_solr
      solr.instance=solrServer
      solr.server.port=3737
      plugin.home=C:/WebSphere/Plugins
      solr.http.port=9079
      solr.https.port=9044
      db.vendor=DB2
      solrGlobalSecurityEnabled=true
      
    6. Open the deploy-profit_margin_wc.private.properties and profit_margin_solr.private.properties files. Set the correct user names and passwords.

      If global security is enabled on the search server, add solr.user and solr.password to the bottom of the deploy-app.private.properties file.

    7. Download and extract the following file: XMLUpdate.zip.

      Copy the extracted XMLUpdate.jar file into the WCBD_installdir/lib directory.

  3. Customize the script for the WebSphere Commerce and Search deployment.

    The WebSphere Commerce Build and Deployment tool does not support workspace deployment or the deployment of customized search files by default. Therefore, a new file is created called profit_margin_wc-common.xml for WebSphere Commerce and profit_margin_solr-common.xml for Search that contains Ant targets.

    For more information on the workspace content deployed, see Tutorial: Adding content managed resources to the Catalog service module.

    For more information on the search customization deployed, see Tutorial: Extending a search profile to retrieve and display custom data in the storefront.

    The wcbd-deploy.xml file is modified to use the new profit_margin_wc-common.xml and profit_margin_solr-common.xml files.

    1. For WebSphere Commerce:
      1. Create the following Ant build file: WCBD_deploy_server_common_dir/profit_margin_wc-common.xml.
      2. Use the content from the following sample to populate the file: Sample content (profit_margin_wc-common.zip)
      3. Save your changes and close the file.
    2. For Search:
      1. Create the following Ant build file: wcbd-deploy-server-local-profit_margin_solr/profit_margin_solr-common.xml.
      2. Use the content from the following sample to populate the file: Sample content (profit_margin_solr-common.zip)
      3. Save your changes and close the file.
  4. Run the server deployment process.
    1. Start the WebSphere Commerce server.
    2. Open a command prompt and navigate to the following directory: WCBD_deploy_server_wc_dir
    3. Run the wcbd-ant command:
      For WebSphere Commerce:
      
      wcbd-ant.bat -buildfile wcbd-deploy.xml -Dtarget.env=profit_margin_wc
      
      For Search:
      
      wcbd-ant.bat -buildfile wcbd-deploy.xml -Dtarget.env=profit_margin_solr
      

      Wait until the deployment process completes successfully.