Blog

Continuous Mobile Development with Jenkins – Presentation Notes

Hi! If you’re here for Adam’s Connect.Tech talk on continuous cross platform mobile development using Jenkins, then you are in the right place!

Slides

Installation Guide

Prerequisites:

Note: If you prefer to install and run everything as a Jenkins user, check out this guide for instructions. Please see the slidedeck for additional notes on isues with Node.js and the jenkins user.

My short and sweet guide is as follows:

Logging in to the Mac’s administrator account, install tools needed to do your x-platform builds:

Xcode (be sure to open it after installing to accept any T&C

Android SDKs – in a place that will be reachable by the jenkins user

Java JDK 1.7 or 1.8, depending on your needs. Jenkins supports both now with version 2.  (verify by running terminal command java -version

226px-Jenkins_logo.svgInstall Jenkins

Mac OS X installer: (2.x LTS)

https://jenkins.io/content/thank-you-downloading-os-x-installer/#stable

Verify with localhost:8080 (will launch automatically)

Cross Platform-Specific I have come across

Security

Lots of (good) changes to Jenkins default security with version 2. You should be walked through setting up a user account upon first launch. Below are my notes for additional security steps:

Enable Security:

  1. Manage Jenkins > Configure Global Security
  2. Check Enable security
  3. Security realm: Jenkins’ own security database
  4. Click Save

Add Users

Now you see Manage Users under Manage Jenkins

  1. Manage Users > Create User
  2. Add an admin account
  3. Add a ‘user’ account

Now enable security to just permit access with the accounts

  1. Manage Jenkins > Configure Global Security
  2. Uncheck allow users to sign up
  3. Authorization: Project-based Matrix Authorization Strategy
    1. Add ‘admin’ and check ‘Administrator’
    2. Add ‘user’ and check ‘Read’
  4. Click Save and now log in with admin account

Finally, enable security on the job so our user can build it

  1. Open the test project, select Configure
  2. Check Enable project-based security
    1. Add the ‘user’ account, and at minimum check
      1. Build
      2. Cancel
      3. Read
  3. Now log in with the user account, you should see the job on the main page

Running builds

There are a multitude of ways to run or ‘trigger’ a build. If you can think of it, it’s probably possibly with Jenkins. Couple of options I’ve found to be useful with our teams:

Build Via URL

JENKINS_URL:8080/job/JOB_NAME/build

And with a parameterized build

JENKINS_URL:8080/job/JOB_NAME/buildWithParameters?param1=hello

More info on paramaterized builds:

https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Build

https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API

Useful Plugins

Other Cool Stuff

Jenkins Alternatives

Leave a Reply