CI/CD Setup
Process for setting up CI/CD pipeline in Mendix apps
Prerequisite: App must be using Git version control, not SVN.
- Confirm the “UnitTesting” module has been added to your app, and at least one test has been added.
- If your app does not have the “UnitTesting” module, add it from the marketplace.
- Check that your app has at least 1 unit test (microflows that start with either “UT_” or “TEST_”
- If not, create a dummy unit test that always returns true.
- Configure your app’s After startup microflow to call UnitTesting.Startup
- Find the After Startup microflow in App Settings > Runtime
- Use a microflow call to call UnitTesting.Startup (this step may already be completed)
- Commit and push changes
- Find the After Startup microflow in App Settings > Runtime
- Create an Acceptance branch by forking from main, and name it “acceptance”
- Make sure all developers who will use this pipeline have API Rights for both environments - Acceptance and Production (Environments > Permissions)

- Set RemoteApiEnabled and RemoteApiPassword for acceptance environment
- Navigate to Environments > Acceptance Details > Model Options
- Scroll down to Constants and search “remote”
- Set “UnitTesting.RemoteApiEnabled” to “True”
- Generate a password using lastpass.com/features/password-generator
- Set “UnitTesting.RemoteApiPassword” to the password you just generated.
- Restart the environment
- Generate a Personal Access Token and API key for your pipelines (Note: this only needs to be done once, it will apply to all pipelines)
- Create a Mendix Personal Access Token for your pipelines
- To find your Mendix API key, navigate to your Mendix user settings https://user-settings.mendix.com/link/profile
- Go to the Developer Settings tab and press New Token
- Name it (something like “pipeline”)
- Select the following boxes:
- Click Create
- Copy and save your Personal Access Token somewhere you’ll remember
- To find your Mendix API key, navigate to your Mendix user settings https://user-settings.mendix.com/link/profile
- Create an API key for your pipelines (if you haven’t already)
- Return to the Developer Settings tab of Mendix User Settings
- Press Configure API Keys
- Press Create New API Key and add a description relating to its use for pipelines
- Copy and save your new API key somewhere you’ll remember
- Create a Mendix Personal Access Token for your pipelines
- Set up BYU’s Mendix Deploy app (Note: this only needs to be done once per developer, it will apply to all apps in Mendix Deploy)
- Log in to https://byu-mendix-deploy.apps.us-2a.mendixcloud.com/index.html
- Press Manage API Info
- Enter your Mendix API key you saved earlier (see step 6)
- Enter your Mendix user name (Likely your BYU email, but can be found by selecting your profile picture on mendix.com)
- Enter your Mendix Personal Access Token you saved earlier (see step 6) and press Save
- Log in to https://byu-mendix-deploy.apps.us-2a.mendixcloud.com/index.html
- Set Pipelines User Settings
- Go to the pipelines tab in your app’s Sprintr page
- Go to the settings tab
- Press Setup
- Enter your Personal Access Token and API Key you saved earlier, and press Save
- Create Mendix Pipeline to put acceptance branch on Acceptance environment
- Go to the pipelines tab in your app’s Sprintr page
- Select Design a Pipeline, then Template pipeline, and name it “Accp branch to Accp”
- Press Next
- Open Start Pipeline
- Set “Branch Expression” to be “acceptance”
- Make sure “Trigger” is set to be “Teamserver push (Git)”
- Scroll down to Deploy and open it
- Set “Environment” to “Acceptance”
- Press Save & Activate
- Create Mendix Pipeline to put main branch on Acceptance environment
- Go to the pipelines tab in your app’s Sprintr page
- Select Design a Pipeline, then Template pipeline, and name it “Main branch to Accp”
- Press Next
- Open Start Pipeline
- Set “Branch Expression” to be “main”
- Make sure “Trigger” is set to be “Teamserver push (Git)”
- Scroll down to Deploy and open it
- Set “Environment” to “Acceptance”
- Press Save & Activate
- Using the Mendix Deploy app, create a pipeline to put the main branch on the Production environment
- Log in to https://byu-mendix-deploy.apps.us-2a.mendixcloud.com/index.html
- Find and select your application from the “Your Applications” list
- If the fields under the Webhook section are empty (name, url, is active, webhook secret), then press Save
- Under the Pipelines section, press New
- Set the “BYU Pipeline Name” to be “Main branch to Prod”
- Under Mendix Pipeline Info, select “TeamServer_Push” for the trigger and “main” from the Branch dropdown menu
- Under BYU Pipeline Info, set the “Job type” to “Scheduled”, set the “Hour” and “Minute” to 8:00, set the “SRC Environment” to “Acceptance”, and set the “DEST Environment” to “Production”
- Your page should look something like the following:
- If yours is not an OIT application and you do not submit RFCs through ServiceNow, check No RFC needed under RFC Info and leave the “Template id” blank. Press Save and skip the following step.
- If yours is an OIT application, go to sn.byu.edu
- Navigate to the Standard Change Templates page (All > Standard Change Template)
- Find the standard change template for your app, and select it
- Copy the “Alias”
- Return to the RFC Info section of the Mendix Deploy app page, and paste the copied Alias into the “Template id” field
- Press Save
- Navigate to the Standard Change Templates page (All > Standard Change Template)
- Log in to https://byu-mendix-deploy.apps.us-2a.mendixcloud.com/index.html
Once these steps are completed, the Mendix CI/CD pipeline is ready. To see a detailed explaination of how to use it, go to the CI/CD process documentation
Author: Matthew Bailey, OIT Application Engineering Campus Life Team • 7/31/2024