Overview

Monaca CI (Continuous Integration & Deployment) is a service that has been integrated within the current Monaca development environment stack to automate building and deployment cycles. This automation process is done by using webhooks. Webhooks allow you to build or set up integrations which subscribe to certain events (code commit, branch/tag creation and so on) on GitHub and many other Git services. For Monaca CI, every time you push your project code to GitHub, GitHub will send a HTTP POST payload to Monaca server. If the received information meets the Monaca CI configuration, the automation will begin.

Therefore, Monaca CI lets developers focus more on the code and less on the backend process of building, testing and deploying an app.

Prerequisite

In order to use Monaca CI, you will need to integrate GitHub with your Monaca account. If you haven’t done it, please follow the instruction below:

  1. Link your Monaca account to GitHub. Please refer to GitHub Integration.
  2. Connect your project to your GitHub repository. Please refer to Version Control Configuration.

Getting Started with Monaca CI

Assuming you have successfully linked a GitHub repository to your project, you are now ready to enable Monaca CI. Please do as follows:

  1. From Monaca Cloud IDE menu, go to Configure → Continuous Integration .

  2. Monaca CI is disabled by default. To enable it, check Triggers and then Save it. That’s it! Now your Monaca CI is ready. You can start pushing your project code to the valid branch or tag as configured. Then, you should be able to find the built files under Build History panel. It may take some time for the build process to be completed.

You have to start building manually in the IDE first (one time only) before the Monaca CI can start the automatic build later. This is because you will need to input a valid keystore (for Android) and upload the right provisioning profile (for iOS) for release build.

Automating Deploy Services

You can also automate your app distribution process with Monaca CI. In order to do this, please do as follows:

  1. From Monaca Cloud IDE menu, go to Configure → Deploy Services .

  2. Click on Add Deploy Service.

  3. Choose a deploy service and fill in the required information such as:

    • Config Alias: a unique identifier for each service

    • Username (DeployGate only): app’s owner’s username or organization name registered in DeployGate

    • API Key (DeployGate) or API Token (HockeyApp/Appetize): API key provided by the deployment service provider. For more information on how to get the API key for each service, please refer to Deploy Services.

    DeployGate
You can have multiple deploy services configured in Monaca CI. You can also have multiple aliases for each deploy service. Please refer to Deploy Services regarding currently supported and upcoming deploy services.

Monaca CI Execution Procedure

Assuming that you want to use Monaca CI to create release build for iOS and Android when you push the project code to a branch called master. Moreover, you want Monaca CI to distribute the built files to 2 deployment services such as DeployGate and HockeyApp.

  1. Code is pushed to GitHub.
  2. If the code is pushed to a valid GitHub’s branch/tag, Monaca server will start building your project. Please go to Build → CI History to see the live process of Monaca CI. Then, you can find the built files in Build History panel ( Build → Build History ).

    Preparing to Build
    Building Complete
    Build Complete

  3. When the build process is successfully completed in Monaca server, the build files will be sent to the configured deployment services.

    DeployGate Dashboard
    HockeyApp Dashboard

See Also: