Use Ant tasks to deploy the project WAR file to an application
server, and configure data sources, properties, and database drivers
that are used by IBM MobileFirst™ Platform Foundation.
A set of Ant tasks is supplied with IBM MobileFirst Platform Server.
Before you begin
See Planning deployment of administration components and runtimes for
the supported deployment topologies.
Before you
deploy your project WAR file and configure the application server,
you must complete the following procedures:
If you use Cloudant® via
https as a database, and WebSphere® Application Server full
profile as an application server, declare the Cloudant signer certificate, as described
in Configuring WebSphere Application Server for
use with Cloudant.
If
you deploy different project WAR files with relational databases,
each WAR file must have its own set of tables. Likewise, if you deploy
different project WAR files with Cloudant,
each WAR file must have its own database to store the JSON documents.
Each supported database type has the following guidelines:
- For DB2®, each WAR file must
have different databases, or schema to store the tables.
- For MySQL, each WAR file must have different databases to store
the tables.
- For Oracle, each WAR file must have different database users to
store the tables.
- For Derby, each WAR file must have different databases to store
the tables.
- For Cloudant, each
WAR file must have different databases, unless a prefix is specified
for the database name, so that several teams use the same database.
For more information, see Creating the Cloudant database.
You must run the Ant task on the computer where the application
server is installed, or the Network Deployment Manager for WebSphere Application Server Network Deployment.
If you want to start the Ant task from a computer on which Worklight Server is
not installed, you must copy the file mf_server_install_dir/WorklightServer/worklight-ant-deployer.jar to
that computer.
The mf_server_install_dir placeholder
is the directory where you installed IBM MobileFirst Platform Server.
Note: If
your application server is
WebSphere Application Server V7.0,
you must add the configuration property
"com.ibm.ws.webcontainer.invokerequestlistenerforfilter
= true". For more information about how to add this property,
see
Configuring WebSphere Application Server V7.0.
Procedure
- Review the environment ID that you used to install the MobileFirst Server administration.
This environment ID is installed as a JNDI property. For more information
about the list of JNDI properties, see List of JNDI properties for MobileFirst Server administration.
Important: If the MobileFirst Server administration
used an environment ID, install the project WAR file with the same
environment ID. Otherwise, that project WAR file cannot be managed
by the MobileFirst Server administration.
- Edit the Ant script that you use later to deploy the Project
WAR File.
- Review the sample configuration files in Sample configuration files, and copy the
Ant file that corresponds to your database. The files for
deploying a project WAR file are named after the following pattern:
configure-appServer-database.xml
For
more information, see table 1, Sample configuration files
provided with IBM MobileFirst Platform Foundation,
in Sample configuration files.
- Follow step 4 of the page Sample configuration files to edit the Ant
file and replace the placeholder values for the properties at the
beginning of the file.
- Each project WAR file that uses Cloudant as a database must have its own
database. By default, the database includes the project name. If several
teams use the same Cloudant database
with projects that have the same names, make the distinction by using
the dbNamePrefix of the <cloudant> element
in the Ant task configureapplicationserver.
- If the MobileFirst Server administration
uses an environment ID, and you run an Ant task for the installation,
add an environmentID attribute to the following Ant
tasks, which are used for the administration installation:
- installworklightadmin
- updateworklightadmin
- uninstallworklightadmin
- configureapplicationserver
- updateapplicationserver
- unconfigureapplicationserver
For more information, see Ant tasks for installation of MobileFirst runtime
environments and Ant tasks for installation of MobileFirst Operations
Console and
Administration Services. Important: The value of the attribute must be the same as the
one used for the MobileFirst Server administration.
- To deploy the project WAR file, run the following command:
ant -f configure-appServer-database.xml install
You
can find the Ant command in mf_server_install_dir/shortcuts
- Save the Ant file. You might need it later to apply a fix
pack or perform an upgrade. For more information, see Identify the MobileFirst WAR
file and prepare the Ant deployment script.
If you do not want to save the passwords, you can replace them by "************" (12
stars) for interactive prompting.