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

improve this page | report issue

This tutorial covers the following topics:

Overview

To develop with IBM MobileFirst Platform Foundation, you use MobileFirst Studio or CLI. MobileFirst Studio and CLI contain an internal MobileFirst Server.
When you move to production, you need an external MobileFirst Server, also called remote MobileFirst Server.

This tutorial is intended for use with 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 these components are deployed to the local development server that is bundled within MobileFirst Studio and CLI. The deployment of the components to the local development server is automated by MobileFirst Studio and CLI.

Each customer environment (for example, development, QA, preproduction, 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 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.

missing_alt

  • 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 or CLI, the MobileFirst project is packaged into a web archive (WAR) file.
All 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 and CLI.

missing_alt

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 MobileFirst Server in three steps:

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

    missing_alt

    For additional information, see the topic about installing MobileFirst Server, in the user documentation.

  2. From IBM Installation Manager, use the Server Configuration Tool to create and run an Ant script that:
    • Creates the necessary MobileFirst Administration database schema and deploys the MobileFirst Administration web applications
    • Deploys the MobileFirst project runtime (WAR file) to the application server.

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

    Creates the necessary MobileFirst Administration database schema and deploys the MobileFirst Administration web applications

    missing_alt

    Deploys the MobileFirst project runtime (WAR file) to the application server

    missing_alt

  3. For more information, see the topic about installing MobileFirst Server, in the user documentation.

    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. Edit the application server configuration file 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>

Deploying 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.
You can also use the MobileFirst Command Line Interface (CLI) to manage these tasks.

missing_alt

For more information, see the IBM MobileFirst Platform Foundation user documentation.

Process review

The previously-described process consists of three main steps:

  1. Application server preparation:
    1. Use IBM Installation Manager to extract the installation files.
    2. Use an Ant script created through the Server Configuration Tool to create and deploy MobileFirst Administration web app and database schemas.
    3. 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 Operations Console.

Preparing the application for deployment

Settings

  • The application-descriptor.xml file contains all the application-specific information and settings. These include:
    • WorklightSettings - A settings page that controls the server URL. This feature is for development only and should be set to disabled when moving to production.
    • Push notifications - Settings related to the setup of push notification
    • Security - App authenticity, web resources encryption, web resources checksum
  • The build-settings.xml file enables you to minify and/or concatenate application files (allowing for reduced network traffic and application file size). This feature is available for the following environments: Android, iOS, Windows 8, Windows Phone 8, BlackBerry 10, Mobile Web, and Desktop Browser.

    For more information on build-settings.xml, see the topic about optimizing MobileFirst applications, in the user documentation.

Preparing the application

Important: Make sure that the application that you prepare for deployment will point to the QA/preproduction/production server, so that it can connect to MobileFirst Server.

Studio

  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

Cluster environments

You can set up several instances of MobileFirst Server 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 with the 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, too.

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, see the topic about installing MobileFirst Server, in the user documentation.

Inclusive terminology note: The Mobile First Platform team is making changes to support the IBM® initiative to replace racially biased and other discriminatory language in our code and content with more inclusive language. While IBM values the use of inclusive language, terms that are outside of IBM's direct influence are sometimes required for the sake of maintaining user understanding. As other industry leaders join IBM in embracing the use of inclusive language, IBM will continue to update the documentation to reflect those changes.
Last modified on November 09, 2016