Deploy schema and data changes with WCBD

We can use WCBD to deploy schema and data changes in sql, xml, dataload, acug, acp, and acpnls files.


Task info

Note that WCBD deploys changes in a specific order:

  1. SQL files

  2. XML files

  3. Dataload files

  4. ACUG files

  5. ACP files

  6. ACPNLS files


Procedure

  1. Create a Data Load project that includes the data files we want to deploy. You have two options:

    1. Build a data package with the WebSphere Commerce Build Tool. Then, extract it to the wcbd/source/ directory. For more information about using WCB to build data package, see Packaging customized code for deployment.

    2. (Developer) Copy your Data Load project to WCInstallDir/wcbd/source directly. For more information about organizing a Data Load project, see WebSphere Commerce Build tool repository structure.

  2. (Developer) Set ANT_HOME and WAS_HOME environment variables. We need to set these environment variables only if we are using WebSphere Commerce Developer.

    1. Copy WCB_installdir/wcbd-setenv.bat.template to WCB_installdir/setenv.bat.

    2. Open WCB_installdir/setenv.bat with a text editor and set the following values:

      Note: The setenv script in the Utility server Docker container is already set to match the runtime environment. Change the setenv script only if you need to apply customizations.

  3. Ensure that the correct JDBC driver path is added. Its value must be CLASSPATH in setenv.bat (for the developer environment), or setenv (for the server environment).

  4. Set security-sensitive build configurations.

    1. Copy WCB_installdir/wcbd-deploy.private.properties.template to WCB_installdir/deploy-targetenv.private.properties. The variable targetenv contains the values for use with target.env when we deploy the data with wcbd-ant.bat target.env. This parameter specifies the target environment to deploy the data to. For example, qa, dev, prod

    2. Configure the following properties in WCB_installdir/deploy-targetenv.private.properties: db.user.name and db.user.password

  5. Set the deployment configurations for use in the deploying process.

    1. Copy WCB_installdir/wcbd-deploy.properties.template to WCB_installdir/deploy-<targetenv>.properties.

    2. Configure the following properties in this file:

        db.name, db.host.name, db.server.port, db.schema.name, db.type, jdbc.url, jdbc.driver.path, jdbc.driver wc.home, was.home

  6. Run wcbd-ant to start the deploying process.

    1. (Developer) wcbd-ant.bat -buildfile wcbd-deploy.xml -Dtarget.env=target-env -Dbuild.label=build.label

    2. ./wcbd-ant -buildfile wcbd-deploy.xml -Dtarget.env=target-env -Dbuild.label=build.label

Previous topic: Deploying schema changes
Next topic: Deploying access control policies


Related tasks
Deploying schema changes