A
AndroidSlave
Guest
HOW TO AUTOMATE YOUR ROM BUILDING PROCESS
... using
... using
Special thanks to @chasmodo for all his support, as well as his wonderful How-To build CM thread located HERE.
I. Donations and Support...
Feel free to post any question here, as well as provide your own scripts. As far as I'm concerned, there are no stupid questions; you are, however, required to search before posting.
Please do not donate to me, donate to the Testicular Cancer Society (Click Here).
II. Introduction...
This guide will direct you on how to setup your android build environment to automate your builds using Jenkins and various shell/bash scripts. As this was initially drafted, it was targeted towards CyanogenMod 10.2, but I am quite confident it can easily be easily modified to work with anything you choose, including LP builds.
This can be a useful process if you want to setup nightly/weekly builds, or if you just want to have a easy-to-use web interface to run your builds without entering the shell.
This guide assumes you have an active build environment (preferably Ubuntu-based), and general linux knowledge.
III. Initializing your build environment...
You will first have to have your build environment setup, and you should already be able to successfully build CM, AOSP, AOKP, or other variants, before moving forward. Furthermore, you are expected to have simple scripting knowledge, or you will not be able to do this. If you need assistance with setting up an android build environment (which is not the focus of this thread), you can get started by Clicking Here, or by looking at @chasmodo's thread by Clicking Here.
It is important to note that your Jenkins home directory is at "/var/lib/jenkins" (not /home/jenkins). As such, to get your build directory in the proper location, you will login normally to your shell, and "su jenkins" (you may have to use su policy, if you don't know how to do this, you may just want to login as root). Do Not login to the system-jenkins-user shell by changing the jenkins user password (I am referring to the System User named jenkins, not your jenkins web-interface). Once logged in as jenkins, do a "cd ~", create your directory (e.g., "cm10.2"), and repo init there (e.g., in /var/lib/jenkins/cm10.2 directory).
IV. Installing Jenkins and Apache Daemons...
Once your build environment has been initialized, you will have to get Jenkins/Hudson setup and running. You can read more about Jenkins software by Clicking Here.
Further, you will need to install and setup apache web server in order to access the Jenkins web interface. Click Here for more information on apache.
The jenkins install process can easily be setup by following the guide Located Here.
After you have successfully installed Jenkins and apache, you may proceed to setting up your automated builds.
V. Setting Up Jenkins Security...
Be sure to setup a Jenkins user account, or a remote user can get your setup and screw up your machine.
Follow the article here:
https://wiki.jenkins-ci.org/display/JENKINS/Standard+Security+Setup
Continued in Post #2
Last edited: