Connecting Jenkins to MobileIron

Thiemo Scherle, 05.06.2017

You are considering connecting MobileIron, the popular Enterprise Mobility Management (EMM) system, to a Jenkins Continuous Integration (CI) server?

Good idea: such a connection enables Continuous Delivery for in-house mobile apps and help you reduce time spent on non-coding activities, build better software and accelerate time to market:

  • There is no need to manually touch anything for a new release.
  • With more frequent releases, the developers get faster feedback on bugs and new features, which help them to improve the software.
  • With the fast feedback and the many releases helps the product managers to get to better software in less time.

Jenkins supports post build actions via plugins. MobileIron offers a comprehensive Rest API, including APIs to upload the deployable app binary (Documentation is available for download at MobileIron). Hence one way to implement continuous delivery is to write a plugin to connect the two, so each new build in Jenkins can be automatically uploaded to MobileIron, and become available to the MobileIron managed mobile devices.

Following cURL can be used to upload my_app.ipa into your MobileIron instance:

curl -u username:password -X POST -F 'installer=@my_app.ipa' 'https://{serverFQDN}/api/v2/appstore/inhouse?adminDeviceSpaceId=1'

Next, you might want also to add the app’s meta data like it’s description and screenshots.

For this you must prepare a JSON file with the data you want to edit as well as the screenshots and the icon file. Example:

{  

   "allowUnmanagedUpdate":true,
    "removeWhenMdmDisabled":true,
    "dataProtectionRequired":true,
    "preventBackup":true,
    "quarantinable":true,
    "appId":"APP-ID",
    "platformType":"I",
    "description":"Description",
    "name":"App Name"

}

Then you may use following cURL command to set metadata:

curl -u username:password - X PUT 'https://{serverFQDN}/api/v2/appstore/apps/update/<APP-ID>?adminDeviceSpaceId=1' -F "appData=@app_data.json" -F phoneScreenshot=@screenshot.png -F phoneScreenshot=@screenshot2.png -F icon=@icon.png

 

However this might be not very convenient to integrate this into Jenkins CI. Note that app_data.json may contain information that can change from version to version thus it should be created dynamically. Additionally, it may be not the best solution to keep all the graphical assets in Jenkins.

And you might want to assign apps to groups of users with MobileIron labels. Without a label, an app remains invisible to users. You set this by the following command:

curl -k -sS -u username:password -X PUT 'https://{serverFQDN}/api/v2/appstore/apps/<APP-ID>/labels/<LABEL-ID>?adminDeviceSpaceId=1'

 

That said, there are some issues with this approach:

  • You spend valuable time writing and maintaining the Jenkins plugin
  • The MobileIron team might deny access to their system, in  particular if you are not the only one building apps for them
  • You might have to support multiple EMM systems over the lifetime of your app and possibly also Apple App Store and Google Play

If this applies to you, take a look at our mobile application release automation software, incapptic Connect:

It provides a Jenkins plugin and MobileIron connectivity out of the box. On top of that, external suppliers can submit their new releases via a self-service portal and go through an approval workflow – key features for a lot of companies.

Simple Mobile. Enterprise

With strategic know-how we help big organizations deal with their large number of mobile apps, whether these are B2C, B2B or B2E.

GET IN TOUCH

Want to know more or have your say?
Message in the comments below.