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
-
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.
-
Likewise, for setting up the data load utility
customization deployment Ant script:
-
If new functionality is needed in the
wsadmin
deployment process:-
Create a helper
wsadmin
Jython script WCBD_deploy_server_dir/project-wsadmin-common.py and add the new methods to the file. -
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.
-
Create a helper
-
To include the new or modified functionality in the
wsadmin
deployment process:- Copy WCBD_deploy_server_dir/scripts/wcbd-wsadmin.py as WCBD_deploy_server_dir/scripts/project-wsadmin.py.
-
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.
-
If new functionality is needed in the Ant build:
-
If new security-sensitive properties (for instance, user names and passwords) are needed for
the new changes:
- Copy WCBD_deploy_server_dir/wcbd-deploy.private.properties.template as WCBD_deploy_server_dir/project-deploy.private.properties.template.
- 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. -
If new properties are needed for the new changes, complete the following step.
- Copy WCBD_deploy_server_dir/wcbd-deploy.properties.template as WCBD_deploy_server_dir/project-deploy.properties.template.
-
If the new
wsadmin
script WCBD_deploy_server_dir/scripts/project-wsadmin.py is created, update thewsadmin.deploy.script.file
property to point to the new file. - 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. -
If new libraries are needed by Ant for the new changes, copy the template files.
- Copy WCBD_deploy_server_dir/wcbd-setenv*.template as WCBD_deploy_server_dir/project-setenv*.template.
-
Update the
CLASSPATH
variable in WCBD_deploy_server_dir/project-setenv*.template.
These files become the new setenv template files for configuration. -
To include the new or modified functionality in the overall server deployment process:
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.
- Optional:
If 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.