Moving from development environment to stand-alone QA and production servers

improve this page | report issue

Overview

To develop with IBM MobileFirst Platform Foundation, MobileFirst Studio is used. MobileFirst Studio contains an internal MobileFirst Server.
When moving to production, an external MobileFirst Server is required.

This tutorial is intended for use with a MobileFirst Server, which is available for purchase from IBM.

A MobileFirst project contains various components, such as applications, adapters, configuration files, custom Java code and libraries.
During the development stages, all of these components are deployed to the local development server that is bundled within MobileFirst Studio. The deployment of the components to the local development server is automated by MobileFirst Studio.

Each customer environment (for example, development, QA, pre-production, production) has its own unique and specific settings. For example, the locations of back-end services, public URLs, database connectivity parameters, and logging settings.

Eventually, you must transfer these settings and components to the remote MobileFirst Server.
This tutorial explains to the developer how to package MobileFirst components and deploy them to a remote server.

The MobileFirst project

The following diagram depicts a MobileFirst project. A MobileFirst project can contain applications, adapters, custom Java code and server - or client- related configuration files.

11_01_mobilefirst_project

  • The custom Java code is added to the \server\java folder
  • The custom libraries are added to the \server\lib folder
  • The server configuration files are in the server\conf folder
  • The client configuration files are in the apps\your-app folder

During a build operation in MobileFirst Studio, the MobileFirst project is packaged into a web archive (WAR) file.
All of the files that are mentioned above are compiled to the project-name.war file in the \bin folder of the project.

The only exceptions are apps and adapters, which are not part of the WAR file. These separate entities are generated by MobileFirst Studio.

11_01_project_war

Installing MobileFirst Server

IBM MobileFirst Platform Foundation is compatible with the following application servers:

  • WebSphere Application Server full profile
  • WebSphere Application Server Liberty profile
  • Apache Tomcat

You can install the MobileFirst Server in three steps:

  1. Using the IBM Installation Manager to extract MobileFirst Server files to the file system.
    missing_alt

    For additional information, review the "Installing MobileFirst Server" user documentation topic.

  2. From the IBM Installation Manager, the Server Configuration Tool is used to create and run an Ant script that:
    • Creates the necessary MobileFirst Administration database schema
    • Deploys the MobileFirst Administration web applications to the application server

    For more information, see Tutorial for a basic installation of MobileFirst Server in the product documentation.

    Creates the necessary Administration Administration database schema

    missing_alt

    Deploys the MobileFirst Administration web applications to the application server

    missing_alt

  3. For additional information, review the "Installing MobileFirst Server" user documentation topic.

    Multiple MobileFirst project files can coexist on an application server. Each is deployed as a WAR file. Each is configured to communicate with a different schema in the database.

    missing_alt

  4. The application server configuration file can be edited with additional MobileFirst properties.
    <configureapplicationserver shortcutsDir="${shortcuts.dir}">
        <project warfile="${worklight.project.war.file}"/>
        <!-- Specify some JNDI properties. -->
        <property name="publicWorkLightHostname" value="my.company.name"/>
        <property name="publicWorkLightPort" value="80"/>
        <property name="publicWorkLightProtocol" value="HTTP"/>
        <property name="serverSessionTimeout" value="10"/>
        <applicationserver>

    missing_alt

Deploy applications and adapters

After you deploy the WAR file to the application server, you can start the application server.
Now the MobileFirst Console can be loaded, at: http://host:port/worklightconsole. The console is used to deploy applications and adapters.
The MobileFirst command line interface can be used as well to administrate these tasks.

missing_alt

For more information, see the IBM MobileFirst user documentation.

Process review

The previously-described process consists of three main steps:

  1. Application server preparation:
    • Use IBM Installation Manager to extract installation files
    • Use an Ant script created through the Server Configuration Tool to create and deploy MobileFirst Administration web app and database schemas
    • Use an Ant script created through the Server Configuration Tool to prepare the database, copy MobileFirst files, and deploy the MobileFirst project .war file
  2. Prepare the application for deployment:
    • Build the application
  3. Deploy the application and adapter files:
    • Deploy applications and adapters by using the MobileFirst Console

Preparing the application for deployment

  • The application-descriptor.xml file contains all the application-specific information and settings. These include:
    • MobileFirst settings
    • Push notifications
    • Security (app authenticity, web resources encryption, web resources checksum)
  • The build-settings.xml file contains Mobile web-specific information and settings. These include:
    • Minification
    • Concatenation

Preparing the application

An important part of preparing an application for deployment is to make sure that it will point to the QA/preproduction/production server, so that the application can connect to MobileFirst Server.

Steps to follow:

  1. In MobileFirst Studio, right-click the application folder
  2. Click Run As > Build Settings and Deploy Target
  3. Select the Build the application to work with a different MobileFirst Server check box
  4. Enter the Server and Context path values

missing_alt

IBM MobileFirst Platform in a cluster environment

Several instances of MobileFirst Server can be set up in a cluster environment that shares a database.

When a .wlapp or .adapter file is deployed on one of the servers in a cluster, it is automatically synchronized to other servers.
When an application or an adapter is deleted from one of the servers in a cluster, it is automatically deleted from the other servers as well.

A WAR file, however, is a part of the application server customization. It must therefore be deployed to each server in the cluster. With WebSphere Application Server Full Profile, you can specify the cluster when the Ant task is called. Otherwise, call the Ant task once for each server in the cluster.

For additional server topologies and information, review the "Installing MobileFirst Server" in the user documentation.

Last modified on November 09, 2016