Here’s a step-by-step guide to build and deploy IOS application using Jenkins:
1. Create Your Accounts
2. Create your BitBucket repo
- Create a repository for your project, and do your first commit.
3. Download and Install Jenkins
- Download and Install Jenkins.
- Go to application -> Jenkins Folder -> Double click on Jenkins.war file ->Go to Safari Browser -> type http://localhost:8080 ->press enter Jenkins server will start .
4. Install Jenkins Plugins
Under ‘Manage Jenkins’ -> ‘Manage Plugins’ -> ‘Available Section’, select and install
- Xcode Plugin
- TestFlight Plugin
- Github and Git Plugins .
- Email-ext plugin and Click on “Download now and install after restart “.
5. Setting up a secured Jenkins instance
- To setup up a secured instance, click on “Manage Jenkins” and then “Configure System”.
- Under “Access Control > Security Realm”, select the “Jenkins’s own user database” option and check the “Allow user to sign up” checkbox below it.
- Under “Access Control > Authorisation”, select the “Logged-in user can do anything”.
- Once you save it, click on the “Sign In” link to create a Jenkins user account.
- (Optional) Once you have created a user and logged in, you’d want to lock down your Jenkins instance and prevent new sign-ins. To do so, go to the “Configure System” page, uncheck the “Allow user to sign up” checkbox below it under “Access Control > Security Realm” section.
6. Configure System configuration
Go to manage Jenkins -> select System Configuration.
- Jenkins Location section :
Change “Jenkins URL” ->[http://ip address:8080] (e.g : http://192.xxx.x.xxx:8080/ ).
Change “System Admin e-mail address” ->provide your email id.
- Email Notification section : Provide all fields value according to you email server configuration.
- Test Flight section :
Go to your test flight account Team info page. Team name as ‘Token Pair Name’ and team token and select the “Upload Api” you get the api_token value.
7. Setting up your first Jenkins iOS job
- Create a new Jenkins job. Lets call it “first-ios-app” (make sure the name you choose doesn’t have spaces) and select “Build a free-style software project” as your job type.
- Setup your “Source Code Management”
- Click on “Add build step”. If you have the Xcode Hudson plugin installed successfully you should be able to select “Xcode” (If not then the plugin was not installed correctly).
- Under “Post-Build Actions”
- Select “E-mail Notification” and provide your_email_id.
- Select “Editable Email Notification” and provide all ‘Project Recipient List’ click on ‘Advanced‘ button you trigger email for build status(success,failure,fixed,unstable etc.).
- Select “Upload to Testflight” and select ‘token pair’ also provide ‘Build Notes’.
- Under “Build Triggers”
- Check the checkbox of “Trigger builds remotely” and provide “Authentication Token” value (this token is used to authenticate your job to repository).
- Go to your bitbucket account and go to specific repository setting option and click on “Hooks” option and select Jenkins.
- Click on add hook button,Provide End Point([jenkins url]/jenkins/job/[job name]/build?token=[Authentication Token]) ,Token(Optional),Project name(Job name),Module Name(Optional).
- Check the checkbox of “Poll SCM” and Schedule the build trigger.
Naveen Kumar Dungarwal
Latest posts by Naveen Kumar Dungarwal (see all)
- FMDB implimentation in IOS Applications - November 22, 2013
- Auto Build and deploy IOS application using Jenkins - September 16, 2013