Setting up Jenkins for building nightlies
Setting up the job
To use Jenkins to build regular nightlies for multiple devices, follow this quick steps:
- Prepare your Android source tree
- Create a new job, as a multi-configuration project
- In Advanced Project Options, check "Custom workspace", and point both the Directory and Directory for sub-builds to the root of your Android tree
- Add a new user-defined axis to the matrix, and call it 'device'. In values, you must put each device you want to build, separated by spaces (e.g. 'mako manta flo deb').
- Check 'Run each configuration sequentially'
- Add a new 'Execute shell' build step, in order to run a short build script. In Omni's case we have a script at the root of our workspace, thus we put './build_nightly.sh $device', where $device will be replaced by each device for each build.
- Save the job, you're all set.
Create then your build script. Here's Omni build script:
#!/bin/bash export USE_CCACHE=1 export CCACHE_DIR=/home/build/.ccache export BUILDTYPE_NIGHTLY=1 DEVICE=$* cd /home/build/omni . build/envsetup.sh repo sync -j48 rm -rf out/target brunch $DEVICE
Adding a device to a nightly job
Just add the device code into the 'device' axis in the job settings.