运行部署实用程序 (runDeployment.sh/.bat)
runDeployment 命令行工具使您能够从命令行部署特定服务器组的交互式渠道,方法是使用概述了所有可能参数的 deployment.properties 文件所提供的和 runDeployment 工具本身所在位置中可用的设置。当您正在使用 OffersBySQL 功能时,从命令行运行交互式渠道部署的能力特别有用。例如,您可能会配置要定期运行的 Campaign 批处理流程图。当流程图运行完成时,可调用触发器以使用此命令行工具来初始化 OffersBySQL 表中商品的部署。
描述
您可以在以下位置中找到自动安装在 Interact 设计时服务器上的 runDeployment 命令行工具:
Interact_home/interactDT/tools/deployment/runDeployment.sh(或者 Windows 服务器上的 runDeployment.bat
传递到该命令的唯一自变量是文件 deployment.properties 的位置,该文件描述了部署“交互式渠道/运行时服务器组”组合时需要的所有可能参数。提供了样本文件供参考。
*
在使用 runDeployment 实用程序之前,必须首先使用任意文本编辑器对其进行编辑以提供服务器上 Java 运行时环境的位置。例如,如果其中任意一个目录包含您希望该实用程序使用的 Java 运行时,那么您可能会指定 Interact_home/jrePlatform_home/jre 作为路径。或者,您也可以提供 IBM® 产品的此发行版支持与其配合使用的任一 Java 运行时环境的路径。
在安全 (SSL) 环境中使用 runDeployment 实用程序
要在 Interact 服务器上启用了安全性(因而可以通过 SSL 端口进行连接)的情况下使用 runDeployment 实用程序,您需要按如下所示添加信任库 Java 属性:
1.
当您正在编辑 deployment.properties 文件以进行交互式渠道部署时,修改 deploymentURL 属性以使用安全 SSL URL,如以下示例中所示:
deploymentURL=https://<HOST>.<DOMAIN>:<PORT>/Campaign/interact/InvokeDeploymentServlet
2.
通过使用任意文本编辑器来编辑 runDeployment.shrunDeployment.bat 脚本以将以下自变量添加到以 ${JAVA_HOME} 开头的行中:
-Djavax.net.ssl.trustStore=<TrustStorePath>
例如,该行在添加信任库自变量后可能如下所示:
${JAVA_HOME}/bin/java -Djavax.net.ssl.trustStore=<TrustStorePath> 
-cp ${CLASSPATH}com.unicacorp.Campaign.interact.deployment.tools.
InvokeDeploymentClient $1
<TrustStorePath> 替换为实际 SSL 信任库的路径。
运行实用程序
已编辑实用程序以提供 Java 运行时环境,并且已定制匹配您环境的 deployment.properties 文件的副本之后,您可以使用以下命令来运行实用程序:
Interact_home/interactDT/tools/deployment/runDeployment.sh deployment.properties
Interact_home 替换为 Interact 设计时安装的实际值,并将 deployment.properties 替换为您为此部署定制的属性文件的实际路径和名称。
样本 deployment.properties 文件
样本 deployment.properties 文件包含您必须定制以匹配您自己的环境的所有参数的带注释列表。样本文件还包含用于描述各参数的内容以及可能需要定制特定值的原因的注释。
###############################################################################
#
# The following properties feed into the InvokeDeploymentClient program.
# The program will look for a deploymentURL setting. The program will post a
# request against that url; all other settings are posted as parameters in
# that request. The program then checks the status of the deployment and
# returns back when the deployment is at a terminal state (or if the
# specified waitTime has been reached).
#
# the output of the program will be of this format:
# <STATE> : <Misc Detail>
#
# where state can be one of the following:
# ERROR
# RUNNING
# SUCCESS
#
# Misc Detail is data that would normally populate the status message area
# in the deployment gui of the IC summary page. NOTE: HTML tags may exist
# in the Misc Detail
#
###############################################################################

###############################################################################
# deploymentURL: url to the InvokeDeployment servlet that resides in Interact
# Design time. should be in the following format:
# http://dt_host:port/Campaign/interact/InvokeDeploymentServlet
###############################################################################
deploymentURL=http://localhost:7001/Campaign/interact/InvokeDeploymentServlet

###############################################################################
# dtLogin: this is the login that you would use to login to the Design Time if
# you had wanted to deploy the IC via the deployment gui inside the IC summary
# page.
###############################################################################
dtLogin=asm_admin

###############################################################################
# dtPW: this is the PW that goes along with the dtLogin
###############################################################################
dtPW=

###############################################################################
# icName: this is the name of the Interactive Channel that you want to deploy
###############################################################################
icName=ic1

###############################################################################
# partition: this is the name of the partition
###############################################################################
partition=partition1

###############################################################################
# request: this is the type of request that you want this tool to execute
# currently, there two behaviors. If the value is "deploy", then the deployment
# will be executed. All other values would cause the tool to simply return the
# status of the last deployment of the specified IC.
###############################################################################
request=deploy

###############################################################################
# serverGroup: this is the name of the server group that you would like to
# deploy the IC.
###############################################################################
serverGroup=defaultServerGroup

###############################################################################
# serverGroupType: this will indicate whether or not this deployment is going
# against production server group or a test server group. 1 denotes production
# 2 denotes test.
###############################################################################
serverGroupType=1

###############################################################################
# rtLogin: this is the account used to authenticate against the server group
# that you are deploying to.
###############################################################################
rtLogin=asm_admin

###############################################################################
# rtPW: this is the password associated to the rtLogin
###############################################################################
rtPW=

###############################################################################
# waitTime: Once the tool submits the deployment request, the tool will check
# the status of the deployment. If the deployment has not completed (or
# failed), then the tool will continue to poll the system for the status until
# a completed state has been reached, OR until the specified waitTime (in
# seconds) has been reached.
###############################################################################
waitTime=5

###############################################################################
# pollTime: If the status of a deployment is still in running state, then the
# tool will continue to check the status. It will sleep in between status
# checks a number of seconds based on the pollTime setting .
###############################################################################
pollTime=3

###############################################################################
# global: Setting to false will make the tool NOT deploy the global settings.
# Non-availability of the property will still deploy the global settings.
###############################################################################
global=true