Baking Clouds Ltd

Baking Clouds provide tailored IT consultancy services to small and medium-sized companies; we cover all aspects of IT without any hidden costs.

IBM Cloud – Mendix Web App

Getting started with Mendix Web App on IBM Cloud

Mendix starter app on IBM Cloud gives you a head start developing a fully-featured web application using the Mendix low-code platform. The app is ready for you to add data structures, pages, and application logic using the visual development environment in Mendix. The app comes with a default theme that you can customize to deliver beautiful, and innovative apps that run on any device.

This how-to will teach you how to do the following:

  • Select an IBM app template and ask Mendix to create the app
  • Create a deployment package for IBM Cloud
  • Deploy to, and test your app on, IBM Cloud

Prerequisites

Before starting this how-to, make sure you have completed the following prerequisites:

  • Have an IBM Cloud account
  • Download the Mendix Desktop Modeler – you will need 7.11.0 or higher
  • Be familiar with the basic concepts of editing and deploying a Mendix app
  • Be familiar with the basic concepts of IBM Starter Kits and Toolchain

Creating the New App

Firstly, you create your Mendix app which you wish to deploy.

  1. Log in to your Mendix Account.
  2. Click Create App to create a new app.
  3. Click an IBM app to choose it as the starting point for your app.
  4. Click Use this app.
  5. Choose a name for your app and click Create App.
  6. Wait while Mendix creates a copy of the starter app you have chosen and takes you to a page from which you can set up IBM Cloud.

Setting Up the Project on IBM Cloud

Mendix knows you want to deploy to IBM Cloud, but you need tell it more about your project so that IBM Cloud can add the resources you need.

To set up IBM Cloud, follow these steps:

  1. Click Setup Cloud.
  2. Log in to IBM Cloud if you are not already logged in.The App name name of your project is already filled in. It is recommended that you do not change this; changing this name will not change the name of your app in the Mendix Developer Portal.
  3. Ensure that the correct account is shown at the top right of the screen (next to your avatar) if you have access to more than one account on IBM Cloud.
  4. Choose the appropriate Resource Group.
  5. Click Create.

  1. Click Link Account.

This is only required for new projects. It links this project to the project on Mendix.

If you have not linked an IBM Cloud project to Mendix before, you will be asked to confirm that IBM Cloud can have access to some of your Mendix data. Please Authorize this.

You will now be returned to the project page.

  1. Click Choose Deployment.Choose DeploymentYou can choose to deploy to Cloud Foundry or Kubernetes.

Deploying to Cloud Foundry

  1. Set the Number of instances; the default is 1.
  2. Set the Memory allocation per instance; the default is 512.
  3. Choose the Region, Organization, Space, and Domain to deploy to.
  4. Change the Host if required; the default is the name of your app.
  5. Click Create.
  6. Wait until the Deployment Details indicate that the toolchain is configured.

Deploying to Kubernetes

  1. Choose the Region, Organization, Space, and Cluster name to deploy to.
  2. Click Create.
  3. Wait until the Deployment Details indicate that the toolchain is configured.

Creating a Package for IBM Cloud

Before you can deploy a package to IBM Cloud you have to create it. At any time, you can create a new deployment package from a committed version of the project. If you are working with the Desktop Modeler you will have to commit the project first.

Deploying from Within the Desktop Modeler

You can deploy your app automatically from the Desktop Modeler. However, you will have less control over the deployment than deploying from the Developer Portal.

Click Run in the Desktop Modeler. This will automatically:

  • commit the project
  • generate a deployment package from the latest commit in the current branch
  • push the deployment package to IBM Cloud

You will still need to go to IBM Cloud and manually deploy the package; a message within the Desktop Modeler will let you know when the package is ready and will give you the link to IBM Cloud.

Deploying from the Developer Portal

To create a package for IBM Cloud within Developer Portal, follow these steps:

  1. Return to the Mendix Developer Portal. If you are looking at your app on IBM Cloud you can click Edit on Mendix to return to Mendix.
  2. Open the Environments page.You are now ready to create a deployment package which you will then push to IBM Cloud.
  3. Click Create package from teamserver.
  4. Select the branch on which to base the build and click Next.
  5. Select the revision of this branch and click Next.
  6. Type a Tag description (optional) and set the version number for this build.
  7. Click Build this revision.
  8. Click OK to confirm the information message.
  9. Click Details next to the deployment package to see details of the deployment package.You can now see and manipulate the package details.
  10. Click Environments to return to the previous page.When the project is built it will appear in the list of deployment packages. While it is being built, there will be a ‘spinner’ showing that the package is not yet complete. Once the package is ready for deployment this will be replaced by a tick.

    The package is still within the Mendix environment and needs to be pushed to IBM Cloud. From there it can be deployed.

  11. Click Push next to the package you want to deploy. This will push this deployment package to IBM Cloud.

Deploying a Package to IBM Cloud

  1. Click the here link or the Open IBM Cloud button to go to your IBM Cloud project page.Alternatively, follow the link you are given in the Desktop Modeler.

    You may need to configure your browser to allow the IBM Cloud page to open.

    You will now be back on your IBM Cloud project page.

  2. Click Deploy Application.You will see a confirmation message in the top right of the screen.

    Mendix app being deployed

  3. Wait until the app is deployed. This can take several minutes.If you want to see the progress then do the following:
    • Click View toolchain
    • Click the DELIVER > Delivery Pipeline tool in the toolchain
    • The Deploy Stage will indicate STAGE PASSED when your app has been deployed (if you are encountering issues, you can click the link on this page to see the build log)

    You can also see when your deployment is complete from the Mendix app’s Environments page.

  4. Click Edit on Mendix to return to Mendix.
  5. Click Environments to see the Mendix environments page.When the deployment is complete you will see your deployed app under Managed by IBM Cloud. You will also see activities related to the deployment under Activity.
  6. Click View App to run and view your app.You can also view your app directly using the url which is given to you:

Runtime Configuration

Once your app is deployed, you can make changes to the runtime on IBM Cloud.

To change your runtime configuration, perform the following steps:

  1. Go to IBM Cloud by clicking the Details button next to your environment, or using the Open IBM Cloud button.
  2. Click Dashboard above the name of your app.The dashboard in the app breadcrumb navigation
  3. Find your app in the Dashboard – use the search box if required.
  4. Click the name of your app. Note that due to naming restrictions some characters in your app name may have been changed or removed (such as the spaces in this example).Select your app from the list
  5. Click Runtime in the menu.The runtime pageYou can now change the number of instances, and the memory for each instance. You can also change the values of application constants, development mode, and scheduled events.

Memory and Instances

To change the memory and instances configuration temporarily, do the following:

  1. Increase or decrease the number of instances, or the memory per instance, using the +/- buttons.
  2. Click Save; the environment will be restarted to apply the new setting.Change runtime memoryYou will get a warning that this change is not permanent – see the note above.

Environment Variables and App Constants

  1. Click Environment variables to change the environment variables.Select environment variables tabThe environment variables contain three pieces of information which can be useful in managing your app. These are:
    • DEVELOPMENT_MODE – this is true if you want the application to run with the Mendix security level of Prototype/demo, or Off (no security); it is recommended that this is changed to false for acceptance or production environments
    • Constants within the app – these have the format *MX{module name}{constant name}
    • SCHEDULED_EVENTS – by default, this is a comma separated list of all the scheduled events enabled in the app
  2. Change the values of these variables by typing the new values. Clicking Save will apply the new values and restart the environment.Select environment variables tab 

Additional Resources

Full discussion of Mendix and environment variables in Cloud Foundry, see Run Mendix in Cloud Foundry in the cf-mendix-buildpack GitHub project

IBM Cloud Pricing

Mendix Mobile App

IBM Cloud account

Mendix Desktop Modeler

IBM Cloud – Mendix Web App
Scroll to top