Skip to content

Instantly share code, notes, and snippets.

@FacuM
Last active September 21, 2017 05:46
Show Gist options
  • Save FacuM/464151bc7624d80ba3464ed9b5e2b9d8 to your computer and use it in GitHub Desktop.
Save FacuM/464151bc7624d80ba3464ed9b5e2b9d8 to your computer and use it in GitHub Desktop.
LOS-OMS build script for Jenkins job.
#!/bin/bash
mkdir -p $WORKSPACE/bin
mkdir -p $WORKSPACE/los
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > $WORKSPACE/bin/repo && chmod a+x $WORKSPACE/bin/repo
export CCACHE_DIR=$WORKSPACE/.ccache
export USE_CCACHE=1
export TO_OR=$(nproc --all)
# Resize the Java Heap size
export _JAVA_OPTIONS="-Xmx4096m"
# Resize the Jack Heap size
export ANDROID_JACK_VM_ARGS="-Xmx4096m -Dfile.encoding=UTF-8 -XX:+TieredCompilation"
cd $WORKSPACE/los
repo init -u git://github.com/LineageOS/android.git -b cm-14.1
mkdir .repo/local_manifests
curl https://raw.githubusercontent.com/LineageOMS/merge_script/master/substratum.xml > .repo/local_manifests/substratum.xml
repo sync -j$(nproc --all)
while [ $? -ne 0 ]
do
repo sync -j$(nproc --all) --force-sync
done
cd ..
curl https://raw.githubusercontent.com/LineageOMS/merge_script/master/lineage_oms_merge.sh > losoms.sh
bash losoms.sh $WORKSPACE/los
cd $WORKSPACE/los
git clone https://github.com/TheMuppets/proprietary_vendor_motorola.git vendor/motorola
. build/envsetup.sh
#make clean && make clobber
brunch harpia
if [ $? -ne 0 ]
then
rm -Rf '/home/jenkins/.jack-server'
. build/envsetup.sh
brunch harpia
if [ $? -ne 0 ]
then
exit 1
fi
fi
cd out/target/product/harpia
sshpass -p 'password' scp lineage* username@uploads.androidfilehost.com:/
cd $WORKSPACE
rm -Rf los bin .ccache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment