Deploy apps from dev to test and prod
Overview
We have built a MobileFirst project containing applications. A WAR file and a set of .wlapp files are created in the bin folder of the project. We now want to deploy the project to a test or production environment. A WAR file is created for every project, regardless of the number of apps it contains.
If we build an entire app, a file named app-name.wlapp is created, containing the code and resources for supported environments. For example...
myApp-all.wlapp
If we build an app only for specific environments, a file named app-name-env-version.wlapp is created per environment. For example...
myApp-iphone-1.0.wlapp
Deploy apps
- Install administration services and the operations console.
We can have several MobileFirst runtime environments managed by the same operations console. Verify we have deployment rights for MPF, such as the role of worklightdeployer or worklightadmin. See Assign administration roles to users and groups.
- For each application in the project, change the settings in application-descriptor.xml to match the target environment.
- Settings screen
- Device provisioning
- Application authenticity
- User authentication
- The Android shared user ID
- We may want to look at the settings in...
server/conf/worklight.properties
Those settings define the default values for the configuration properties on the server. When we deploy the projects on the server, we can replace the default settings in worklight.properties with values relevant for the target environment.
- Build each application in either of two ways:
- Right-click the application and click...
Run As | Build All Environments
- Use the Ant script tool
If we use MobileFirst tools, the project WAR file is named...
\bin\projectName.war
This file contains the project configuration that was done in steps 1 and 2 and any classes built from Java code in...
server/java
- Configure a database and deploy the project WAR to the application server with one of these two methods:
- With the MobileFirst Server Configuration Tool.
- With Ant tasks for configuring a database for a MobileFirst project and deploying a MobileFirst project WAR file to an application server. With this method, we can also configure the project on the server using JNDI environment entries.
- The documentation of the Ant tasks for configuring a database is at Create databases with Ant tasks.
- The documentation of the Ant tasks for deploying a project WAR file is at Deploy a project WAR file and configuring the application server with Ant tasks.
- The list of JNDI environment entries that can be configured is at Configure a MobileFirst project in production using JNDI environment entries.
- We can find sample Ant files that use these Ant tasks in the MobileFirst distribution in MF_HOME/WorklightServer/configuration-samples. Their file names use the naming convention configure-appServer-database.xml. See Sample configuration files.
- First call configuredatabase, the databases target in the sample Ant files.
- Then call configureapplicationserver, the install target in the sample Ant files.
- Open the operations console of the target environment.
If the operations console is installed with the default context root, its URL is of the form https://your-remote-server:server-port/worklightconsole. If HTTPS is not supported in the application server, it is the unsecured URL http://your-remote-server:server-port/worklightconsole.
Important: If we access the operations console through HTTP instead of HTTPS, the MobileFirst administration user password is compromised.
- From the operations console, deploy the relevant .wlapp files from the bin folder of the project.
- For more information about how to deploy an application using operations console, see Deploy apps.
- We can also deploy the app to the target environment using the MobileFirst Server administration command-line tools. For more information about how to deploy an app using the provided command-line tools, see wladm Ant task and Administer MobileFirst applications through the command line.
- Deploy the adapters from the development environment.
- Navigate to the bin folder in your project.
- Copy the .adapter file or files.
- From the operations console, deploy the .adapter files from the bin folder of the project.
- For more information about how to deploy an adapter using operations console, see Deploy adapters.
- We can also deploy the adapter to the target environment using the MobileFirst Server administration command-line tools. For more information about how to deploy an app using the provided command-line tools, see wladm Ant task and Administer MobileFirst applications through the command line.
Results
A message is displayed, indicating whether the deployment action succeeded or failed.
Parent topic: Deploy MobileFirst applications to test and production environments