Customizing the server deployment process

Advanced users can customize the server deployment process by using the Apache Ant scripting language. This task guides you through creating your customization files for use with the WebSphere Commerce Build and Deployment tool.

About this task

WCBD_deploy_server_dir/wcbd-deploy-common.xml provides helper Ant targets that are reusable and serves as examples for customization. For more information, refer to the comments within the file.

Procedure

  1. Set up the static web assets deployment Ant script. If the file transfer protocol used in your customization project is not a protocol that has sample scripts provided, you must develop custom scripts. The following steps develop custom scripts, where protocol refers to an identifier that represents the file transfer protocol that you intend to use.
    1. Copy WCBD_deploy_server_dir/static-web-deploy/wcbd-static-web-deploy.private.properties.template as WCBD_deploy_server_dir/static-web-deploy-protocol.private.properties.
    2. Copy WCBD_deploy_server_dir/static-web-deploy/wcbd-static-web-deploy.properties.template as WCBD_deploy_server_dir/static-web-deploy-protocol.properties.
    3. Copy WCBD_deploy_server_dir/static-web-deploy/wcbd-static-web-deploy.xml.template as WCBD_deploy_server_dir/static-web-deploy-protocol.xml.
    4. For IBM i OS operating systemSolarisLinuxAIXChange the file permission with the following commands:
       chmod 755 WCBD_deploy_server_dir/static-web-deploy-protocol.*
    5. Open WCBD_deploy_server_dir/static-web-deploy-protocol.xml with a text editor and replace the name attribute of the root project element from wcbd-static-web-deploy to static-web-deploy-protocol. Then, write the custom logic to transfer the static web server asset to the web server with the protocol you require. Refer to comments in the file for details.
    6. Open WCBD_deploy_server_dir/static-web-deploy-protocol.private.properties with a text editor and add any security-sensitive properties (for instance, user names and passwords) that might be needed by WCBD_deploy_server_dir/static-web-deploy-protocol.xml. Properties in this file are encoded when the deployment process is executed.
    7. Open WCBD_deploy_server_dir/static-web-deploy-protocol.properties with a text editor and add any properties that might be needed by WCBD_deploy_server_dir/static-web-deploy-protocol.xml.
  2. WebSphere Commerce Version 7.0.0.0WebSphere Commerce Version 7.0.0.1Likewise, for setting up the WebSphere Commerce configuration file synchronization Ant script:
    1. Copy WCBD_deploy_server_dir/wc-server-sync/wcbd-wc-server-sync.private.properties.template as WCBD_deploy_server_dir/wc-server-sync-protocol.private.properties.
    2. Copy WCBD_deploy_server_dir/wc-server-sync/wcbd-wc-server-sync.properties.template as WCBD_deploy_server_dir/wc-server-sync-protocol.properties.
    3. Copy WCBD_deploy_server_dir/wc-server-sync/wcbd-wc-server-sync.xml.template as WCBD_deploy_server_dir/wc-server-sync-protocol.xml.
    4. For IBM i OS operating systemSolarisLinuxAIXChange the file permission with the following commands:
       chmod 755 WCBD_deploy_server_dir/wc-server-sync-protocol.*
    5. Open WCBD_deploy_server_dir/wc-server-sync-protocol.xml with a text editor and replace the name attribute of the root project element from wcbd-wc-server-sync to wc-server-sync-protocol. Then, write the custom logic to transfer the configuration file to the WebSphere Commerce server with the protocol you require. Refer to comments in the file for details.
    6. Open WCBD_deploy_server_dir/wc-server-sync-protocol.private.properties with a text editor and add any security-sensitive properties (for instance, user names and passwords) that might be needed by WCBD_deploy_server_dir/wc-server-sync-protocol.xml. Properties in this file are encoded when the deployment process is executed.
    7. Open WCBD_deploy_server_dir/wc-server-sync-protocol.properties with a text editor and add any properties that might be needed by WCBD_deploy_server_dir/wc-server-sync-protocol.xml.
  3. WebSphere Commerce Version 7.0.0.2 or laterLikewise, for setting up the data load utility customization deployment Ant script:
    1. Copy WCBD_deploy_server_dir/dataload-cust-deploy/wcbd-dataload-cust-deploy.private.properties.template as WCBD_deploy_server_dir/dataload-cust-deploy-protocol.private.properties.
    2. Copy WCBD_deploy_server_dir/dataload-cust-deploy/wcbd-dataload-cust-deploy.properties.template as WCBD_deploy_server_dir/dataload-cust-deploy-protocol.properties.
    3. Copy WCBD_deploy_server_dir/dataload-cust-deploy/wcbd-dataload-cust-deploy.xml.template as WCBD_deploy_server_dir/dataload-cust-deploy-protocol.xml.
    4. For IBM i OS operating systemSolarisLinuxAIXChange the file permission with the following commands:
       chmod 755 WCBD_deploy_server_dir/dataload-cust-deploy-protocol.*
    5. Open WCBD_deploy_server_dir/dataload-cust-deploy-protocol.xml with a text editor and replace the name attribute of the root project element from wcbd-dataload-cust-deploy to dataload-cust-deploy-protocol. Then, write the custom logic to transfer the configuration file to the WebSphere Commerce server with the protocol you require. Refer to comments in the file for details.
    6. Open WCBD_deploy_server_dir/dataload-cust-deploy-protocol.private.properties with a text editor and add any security-sensitive properties (for instance, user names and passwords) that might be needed by WCBD_deploy_server_dir/dataload-cust-deploy-protocol.xml. Properties in this file are encoded when the deployment process is executed.
    7. Open WCBD_deploy_server_dir/dataload-cust-deploy-protocol.properties with a text editor and add any properties that might be needed by WCBD_deploy_server_dir/dataload-cust-deploy-protocol.xml.
  4. If new functionality is needed in the wsadmin deployment process:
    1. Create a helper wsadmin Jython script WCBD_deploy_server_dir/project-wsadmin-common.py and add the new methods to the file.
    2. If a modified version of existing helper methods (and any method that might depend on it) is needed, copy the target from WCBD_deploy_server_dir/wcbd-wsadmin-common.py to the new helper wsadmin Jython script, then modify the methods.
  5. To include the new or modified functionality in the wsadmin deployment process:
    1. Copy WCBD_deploy_server_dir/scripts/wcbd-wsadmin.py as WCBD_deploy_server_dir/scripts/project-wsadmin.py.
    2. Modify the logic in WCBD_deploy_server_dir/scripts/project-wsadmin.py to incorporate the new changes. Ensure that WCBD_deploy_server_dir/scripts/project-wsadmin-common.py is imported by using the execfile method. Refer to comments in the file for details.
  6. If new functionality is needed in the Ant build:
    1. Create a helper Ant build file that is called WCBD_deploy_server_dir/project-deploy-common.xml.
    2. Open the file with a text editor and add the following line after the root project element open tag:
       <import file="${basedir}/wcbd-deploy-common.xml" /> 
    3. Add new targets to the file as needed. Existing helper target and any target that might depend on it can be overridden with the specification of the Ant importtask.
  7. If new security-sensitive properties (for instance, user names and passwords) are needed for the new changes:
    1. Copy WCBD_deploy_server_dir/wcbd-deploy.private.properties.template as WCBD_deploy_server_dir/project-deploy.private.properties.template.
    2. Add the new properties to the end of the file. Refer to comments in the file for details.
    This file becomes the new properties template file for configuration.
  8. If new properties are needed for the new changes, complete the following step.
    1. Copy WCBD_deploy_server_dir/wcbd-deploy.properties.template as WCBD_deploy_server_dir/project-deploy.properties.template.
    2. If the new wsadmin script WCBD_deploy_server_dir/scripts/project-wsadmin.py is created, update the wsadmin.deploy.script.file property to point to the new file.
    3. Add the new properties to the end of the file. Refer to comments in the file for details.
    This file becomes the new properties template file for configuration.
  9. If new libraries are needed by Ant for the new changes, copy the template files.
    1. Copy WCBD_deploy_server_dir/wcbd-setenv*.template as WCBD_deploy_server_dir/project-setenv*.template.
    2. Update the CLASSPATH variable in WCBD_deploy_server_dir/project-setenv*.template.
    These files become the new setenv template files for configuration.
  10. To include the new or modified functionality in the overall server deployment process:
    1. Copy WCBD_deploy_server_dir/wcbd-deploy.xml as WCBD_deploy_server_dir/project-deploy.xml.
    2. If the new helper Ant build file WCBD_deploy_server_dir/project-deploy-common.xml is created, change the following line in WCBD_deploy_server_dir/project-deploy.xml:
       <import file="${basedir}/wcbd-deploy-common.xml" /> 
      to:
       <import file="${basedir}/project-deploy-common.xml" /> 
    3. Modify the logic of the server deployment process to incorporate the new changes. Refer to comments in the file for details.

    Customizing the files for Configuring the server deployment settings and Running the server deployment process is performed in the same manner as for default assets, except that the project-* files are used instead of the wcbd-* files.

  11. Optional: WebSphere Commerce Version 7.0.0.8 or laterIf your custom build process performs any database operations through Ant tasks, use the WCSQL task to acquire the database connections for the Ant task operations.
    By using the WCSQL task, you can use a unified method for acquiring the database connections for utilities and Ant tasks operations. The WCSQL task is defined within the wcbd-deploy-common.xml. To use the tasks, reference the task as you would the SQL or SQLExec task. For example, the following code references the WCSQL task:
    <code>
    <!-- The following invocation prints the contents of the SITE table -->
      <wcsql driver="${jdbc.driver}"
        url="${jdbc.url}"
        userid="${db.user.name}"
        password="${db.user.password}"
        print="true"
        classpath="${jdbc.driver.path}">
        SELECT * FROM SITE;
      </wcsql>
    </code>

    For more information about the unified method for acquiring database connections for utilities and Ant tasks, see Database connection acquisition for utilities and Ant tasks.

What to do next

After you complete the customization, you must copy the new files to the WCBD_installdir/deploy/server directory on the build system. If applicable, check the files into your SCM to ensure that your changes are available in a subsequent build.