Customizing the Enterprise Deployment Utility to deploy WebSphere Commerce customization

You can customize the Enterprise Deployment Utility to perform custom tasks.

About this task

These steps add new logic to deploy your WebSphere Commerce customization to the development environment using the toolkit deployment package created by the WebSphere Commerce Build and Deployment tool.

Procedure

  1. Open the file WCDE_installdir/Enterprise Deployment/custom/build.xml with a text editor.
  2. Add a custom target called deploy_customization to the WCDE_installdir/Enterprise Deployment/custom/build.xml file
    At the bottom of the file, before the </project> tag, add the following code:
        <!--
         Target name: deploy_customization
         
         Deploys WebSphere Commerce customization with a toolkit deployment package
         created by the Build and deployment tool.
        -->
        <target name="deploy_customization">
            <!--
             Extract the toolkit deployment package to WCDE_installdir/wcbd-pak
            -->
            <property name="wcbd_pak" value="${install_location_TK}/wcbd-pak" />
            <delete dir="${wcbd_pak}" quiet="true" />
            <unzip dest="${wcbd_pak}"
                   src="${ENT_DEPLOY}/wcbd_assets/${deploy_pak_name}.zip" />
    
            <!--
             Set WCDE_HOME in setenv.bat to WCDE_installdir dynamically 
            -->
            <pathconvert property="install_location_TK.converted" dirsep="\\\\">
                <path id="install_location_TK">
                    <pathelement location="${install_location_TK}" />
                </path>
            </pathconvert>
            <copy file="${wcbd_pak}/${deploy_pak_name}/wcbd-setenv.bat.template"
                  tofile="${wcbd_pak}/${deploy_pak_name}/setenv.bat"
                  overwrite="true" />
            <replaceregexp file="${wcbd_pak}/${deploy_pak_name}/setenv.bat"
                           flags="m"
                           match="set WCDE_HOME=.*"
                           replace="set WCDE_HOME=${install_location_TK.converted}" />
    
            <!-- Run the toolkit deployment process -->
            <exec dir="${wcbd_pak}/${deploy_pak_name}"
                  executable="${wcbd_pak}/${deploy_pak_name}/wcbd-rad-ant.bat"
                  failonerror="true">
               <arg line="-buildfile ${deploy_script_name} -Dtarget.env=${target_env}" />
            </exec>
        </target>
  3. Search for the custom_install target, and append the following <antcall> element into the target to call the new deploy_customization target:
    <antcall target=”deploy_customization” />
  4. Save the file and exit.
  5. Open WCDE_installdir/Enterprise Deployment/custom/properties/custom.properties with a text editor.
  6. Add the new properties that are used by the new deploy_customization target:
    #-------------------------------------------------------------------------------
    # Properties used for deploying WebSphere Commerce customization with toolkit
    # deployment package generated by the Build and Deployment tool
    #-------------------------------------------------------------------------------
    
    ##
    # The name of the toolkit deployment package generated by the Build and
    # Deployment tool, without the file extension, in the wcbd_assets directory
    # that is used by the Enterprise Deployment Utility to deploy WebSphere Commerce
    # customization to the development environment.
    #
    # @example
    #   wcbd-deploy-toolkit-V1.0
    #
    deploy_pak_name=
    
    ##
    # The name of the main Ant build file used to invoke the toolkit deployment
    # process. It is typically wcbd-deploy.xml if the toolkit deployment process is
    # not customized.
    #
    # @default
    #   wcbd-deploy.xml
    #
    deploy_script_name=wcbd-deploy.xml
    
    ##
    # The identifier of the target environment that the toolkit deployment process
    # uses to load deployment settings.
    #
    target_env=
  7. Save the file and exit.