As a Mendix user with an IBM Cloud account you have access to many IBM resources which you want to use in a Mendix app. This how-to shows you how to create a Mendix app on the Mendix platform and then deploy it to IBM Cloud.
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 on the IBM Cloud
- Deploy and test your app on the IBM Cloud
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. If you are new to Mendix, the Starter App Tutorial will introduce you to these concepts
3 Creating the New App and Setting Up IBM Cloud
You have decided to create a new Mendix app using an IBM template which you will ask Mendix to deploy to your IBM Cloud.
3.1 Creating a New App
First you will create your Mendix app which you wish to deploy.
To start creating a new app, follow these steps:
Log in to your Mendix Account.
Click Create App to create a new app.
Click an IBM app to choose it as the starting point for your app.
Click Use this app.
Choose a name for your app and click Create App.
Wait while Mendix creates a copy of the starter app you have chosen and takes you to IBM Cloud.
3.2 Setting Up the Project on IBM Cloud
You are now on IBM Cloud and need to tell it more about your project, so that IBM Cloud can add the resources you need.
To set up IBM Cloud, follow these steps:
Click Setup Cloud.
Log in to IBM Cloud if you are not already logged in. The name of your project is already filled in.
Currently you can only deploy your project in the US South region, so make sure that this is selected in Select region to deploy in.
Click Create Project.
Click Choose Deployment to choose the deployment method for this app, for example the database you will be using.
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.
Click Choose Deployment again.
Currently only Cloud Foundry is supported.
Check that Number of instances is 1.
Set Memory allocation per instance to 512.
Click Create and wait until the Deployment Details indicate that the toolchain is configured.
Your IBM environment is now configured.
3.3 Creating a Package for IBM Cloud
Before you can deploy a package on IBM Cloud you have to create it.
To create a package for IBM Cloud, follow these steps:
Click Edit on Mendix to return to Mendix.
Open the Environments page.
You are now ready to create a deployment package which you will then push to IBM Cloud. It is only after the deployment package has been created and pushed to IBM Cloud that you can deploy your app.
Click Create package from teamserver.
Select the branch on which to base the build and click Next.
Initially, you will only have the Main line. However, when you create deployment packages in the future, there may be other branches available.
Select the revision of this branch and click Next.
You will see a number if revisions. Note that a package cannot be created from the first revision as this contains no application template.
Please do not choose to create a package from revision number 1.
Type a Tag description (optional) and set the version number for this build.
Click Build this revision.
Click OK to confirm the information message.
Click Details next to the deployment package to see details of the deployment package.
You can now see and manipulate the package details.
Click Environments to return to the previous page.
3.4 Deploying a Package on IBM Cloud
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.
To push and deploy the package on IBM Cloud, follow these steps:
Click Push next to the package you want to deploy. This will push this deployment package to IBM Cloud.
A request to deploy is sent to IBM Cloud. Currently you have to do this deployment manually.
Click the here link or the Open IBM Cloud button to go to your IBM Cloud project page.
You will now be back on your IBM Cloud project page.
Click Deploy Application.
Wait until the app is deployed. You will see that the Last deploy is a new deployment and has been deployed very recently.
Click Edit on Mendix to return to Mendix.
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.
Click View App to run and view your app.
Under some circumstances this button is not active. You may have to refresh the page, or go to another page and return to make it active.
You can also view your app directly using the url which is given to you: