mirror of
https://github.com/lineageos4microg/docker-lineage-cicd
synced 2024-11-09 10:09:56 +01:00
Add multibranch support
It's now possible to build multiple branches with the same docker image. A full LineageOS mirror is downloaded and created locally (~200 GB).
This commit is contained in:
parent
4176346648
commit
324a10e762
20
Dockerfile
20
Dockerfile
@ -1,10 +1,11 @@
|
|||||||
FROM ubuntu:16.04
|
FROM debian:stretch
|
||||||
MAINTAINER Nicola Corna <nicola@corna.info>
|
MAINTAINER Nicola Corna <nicola@corna.info>
|
||||||
|
|
||||||
# Environment variables
|
# Environment variables
|
||||||
#######################
|
#######################
|
||||||
|
|
||||||
ENV SRC_DIR /srv/src
|
ENV SRC_DIR /srv/src
|
||||||
|
ENV TMP_DIR /srv/tmp
|
||||||
ENV CCACHE_DIR /srv/ccache
|
ENV CCACHE_DIR /srv/ccache
|
||||||
ENV ZIP_DIR /srv/zips
|
ENV ZIP_DIR /srv/zips
|
||||||
ENV LMANIFEST_DIR /srv/local_manifests
|
ENV LMANIFEST_DIR /srv/local_manifests
|
||||||
@ -28,7 +29,7 @@ ENV USE_CCACHE 1
|
|||||||
# for no limit.
|
# for no limit.
|
||||||
ENV CCACHE_SIZE 50G
|
ENV CCACHE_SIZE 50G
|
||||||
|
|
||||||
# Environment for the LineageOS Branch name
|
# Environment for the LineageOS branches name
|
||||||
# See https://github.com/LineageOS/android_vendor_cm/branches for possible options
|
# See https://github.com/LineageOS/android_vendor_cm/branches for possible options
|
||||||
ENV BRANCH_NAME 'cm-14.1'
|
ENV BRANCH_NAME 'cm-14.1'
|
||||||
|
|
||||||
@ -52,6 +53,10 @@ ENV OTA_URL ''
|
|||||||
ENV USER_NAME 'LineageOS Buildbot'
|
ENV USER_NAME 'LineageOS Buildbot'
|
||||||
ENV USER_MAIL 'lineageos-buildbot@docker.host'
|
ENV USER_MAIL 'lineageos-buildbot@docker.host'
|
||||||
|
|
||||||
|
# Include proprietary files, downloaded automatically from github.com/TheMuppets/
|
||||||
|
# Only some branches are supported
|
||||||
|
ENV INCLUDE_PROPRIETARY true
|
||||||
|
|
||||||
# If you want to start always fresh (re-download all the source code everytime) set this to 'true'
|
# If you want to start always fresh (re-download all the source code everytime) set this to 'true'
|
||||||
ENV CLEAN_SRCDIR false
|
ENV CLEAN_SRCDIR false
|
||||||
|
|
||||||
@ -125,6 +130,7 @@ ENV OPENDELTA_BUILDS_JSON ''
|
|||||||
# Create Volume entry points
|
# Create Volume entry points
|
||||||
############################
|
############################
|
||||||
VOLUME $SRC_DIR
|
VOLUME $SRC_DIR
|
||||||
|
VOLUME $TMP_DIR
|
||||||
VOLUME $CCACHE_DIR
|
VOLUME $CCACHE_DIR
|
||||||
VOLUME $ZIP_DIR
|
VOLUME $ZIP_DIR
|
||||||
VOLUME $LMANIFEST_DIR
|
VOLUME $LMANIFEST_DIR
|
||||||
@ -140,6 +146,7 @@ COPY src/ /root/
|
|||||||
# Create missing directories
|
# Create missing directories
|
||||||
############################
|
############################
|
||||||
RUN mkdir -p $SRC_DIR
|
RUN mkdir -p $SRC_DIR
|
||||||
|
RUN mkdir -p $TMP_DIR
|
||||||
RUN mkdir -p $CCACHE_DIR
|
RUN mkdir -p $CCACHE_DIR
|
||||||
RUN mkdir -p $ZIP_DIR
|
RUN mkdir -p $ZIP_DIR
|
||||||
RUN mkdir -p $LMANIFEST_DIR
|
RUN mkdir -p $LMANIFEST_DIR
|
||||||
@ -150,15 +157,18 @@ RUN mkdir -p $USERSCRIPTS_DIR
|
|||||||
|
|
||||||
# Install build dependencies
|
# Install build dependencies
|
||||||
############################
|
############################
|
||||||
|
RUN echo 'deb http://deb.debian.org/debian sid main' >> /etc/apt/sources.list
|
||||||
|
RUN echo 'deb http://deb.debian.org/debian experimental main' >> /etc/apt/sources.list
|
||||||
|
COPY apt_preferences /etc/apt/preferences
|
||||||
RUN apt-get -qq update
|
RUN apt-get -qq update
|
||||||
RUN apt-get -qqy upgrade
|
RUN apt-get -qqy upgrade
|
||||||
|
|
||||||
RUN apt-get install -y bc bison build-essential ccache cron curl flex \
|
RUN apt-get install -y bc bison build-essential ccache cron curl flex \
|
||||||
g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev \
|
g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev \
|
||||||
lib32readline6-dev lib32z1-dev libesd0-dev liblz4-tool libncurses5-dev \
|
lib32readline-dev lib32z1-dev libesd0-dev liblz4-tool libncurses5-dev \
|
||||||
libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop \
|
libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop \
|
||||||
maven openjdk-8-jdk pngcrush rsync schedtool squashfs-tools wget xdelta3 \
|
maven openjdk-7-jdk openjdk-8-jdk pngcrush procps python rsync schedtool \
|
||||||
xsltproc zip zlib1g-dev
|
squashfs-tools wget xdelta3 xsltproc yasm zip zlib1g-dev
|
||||||
|
|
||||||
RUN curl https://storage.googleapis.com/git-repo-downloads/repo > /usr/local/bin/repo
|
RUN curl https://storage.googleapis.com/git-repo-downloads/repo > /usr/local/bin/repo
|
||||||
RUN chmod a+x /usr/local/bin/repo
|
RUN chmod a+x /usr/local/bin/repo
|
||||||
|
60
README.md
60
README.md
@ -2,23 +2,17 @@
|
|||||||
|
|
||||||
Docker microservice for LineageOS Continuous Integration and Continous Deployment
|
Docker microservice for LineageOS Continuous Integration and Continous Deployment
|
||||||
|
|
||||||
## Why
|
This branch contains a version suitable to build for multiple devices on different branches with the same Docker image: to do so it is necessary to download the full LineageOS mirror, about 200 GB. You probably want the more simple version in the master branch.
|
||||||
|
|
||||||
Because I always believe that even advanced technologies should be available to everyone. This is a tentative to offer everyone the possibility to build his own images of LineageOS, when he wants, how he wants. You don't have to wait anymore for build bots. No more scene drama. Just build and enjoy your favourite Android ROM.
|
|
||||||
|
|
||||||
## Why Docker?
|
|
||||||
|
|
||||||
Because I'm a big fan of isolating everything if possible. I don't want to reinstall my OS or triage with dirty packages, just because today I need somethng, and tomorrow I'll need something else.
|
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- At least Dual Core CPU (Higher is better)
|
- At least Dual Core CPU (Higher is better)
|
||||||
- At least 6GB RAM (Higher is better)
|
- At least 6GB RAM (Higher is better)
|
||||||
- At least 250GB HDD Space (Higher is better)
|
- At least 500GB HDD Space (Higher is better)
|
||||||
|
|
||||||
### Android propretary binaries
|
### Android propretary binaries
|
||||||
|
|
||||||
By default when you build Android from scratch you need to pull the Binaries of your interested device via ADB. Although via this Docker is not possible to do so (would imply having all the devices connected to that machine and ideally know how to switch from one to the other before pulling). Therefore, I highly suggest to download this manifest (https://github.com/TheMuppets/manifests) inside your mapped `/srv/local_manifests` folder.
|
By default when you build Android from scratch you need to pull the binaries of your interested device via ADB. When the INCLUDE_PROPRIETARY variable is set to true (default), the proprietary binaries are downloaded automatically from [TheMuppets repository](https://github.com/TheMuppets); if you want to provide your own binaries, set this variable to false and add a corresponding XML in the local_manifests volume.
|
||||||
|
|
||||||
## How it works
|
## How it works
|
||||||
|
|
||||||
@ -55,6 +49,7 @@ Instead of scheduling the execution, build it now and exit.
|
|||||||
For each device, create a subdir `device_codename` in /home/user/zips and move the builds there.
|
For each device, create a subdir `device_codename` in /home/user/zips and move the builds there.
|
||||||
```
|
```
|
||||||
docker run \
|
docker run \
|
||||||
|
--cap-add=SYS_ADMIN \
|
||||||
-d \
|
-d \
|
||||||
-e "USER_NAME=John Doe" \
|
-e "USER_NAME=John Doe" \
|
||||||
-e "USER_MAIL=john.doe@awesome.email" \
|
-e "USER_MAIL=john.doe@awesome.email" \
|
||||||
@ -74,6 +69,7 @@ Finally provide a custom OTA URL for this ROM so users can update using built-in
|
|||||||
```
|
```
|
||||||
docker run \
|
docker run \
|
||||||
--restart=always \
|
--restart=always \
|
||||||
|
--cap-add=SYS_ADMIN \
|
||||||
-d \
|
-d \
|
||||||
-e "USER_NAME=John Doe" \
|
-e "USER_NAME=John Doe" \
|
||||||
-e "USER_MAIL=john.doe@awesome.email" \
|
-e "USER_MAIL=john.doe@awesome.email" \
|
||||||
@ -90,17 +86,19 @@ docker run \
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Custom mode
|
### Custom mode
|
||||||
You can also apply some modifications to the LineageOS code before building it. This example is the build script used for [LineageOS for microG](https://lineage.microg.org), which has integrated microG apps and F-Droid (with F-Droid Privileged Extension).
|
You can also apply some modifications to the LineageOS code before building it.
|
||||||
```
|
```
|
||||||
docker run \
|
docker run \
|
||||||
--name=lineage-$(date +%Y%m%d_%H%M) \
|
--name=lineage-$(date +%Y%m%d_%H%M) \
|
||||||
|
--cap-add=SYS_ADMIN \
|
||||||
-d \
|
-d \
|
||||||
-e "USER_NAME=John Doe" \
|
-e "USER_NAME=John Doe" \
|
||||||
-e "USER_MAIL=john.doe@awesome.email" \
|
-e "USER_MAIL=john.doe@awesome.email" \
|
||||||
-e "WITH_SU=false" \
|
-e "WITH_SU=false" \
|
||||||
-e "RELEASE_TYPE=microG" \
|
-e "RELEASE_TYPE=myrelease" \
|
||||||
|
-e "BRANCH_NAME=cm-14.1" \
|
||||||
-e "DEVICE_LIST=$DEVICES" \
|
-e "DEVICE_LIST=$DEVICES" \
|
||||||
-e "OTA_URL=https://api.lineage.microg.org" \
|
-e "OTA_URL=http://cool.domain/api" \
|
||||||
-e "CRONTAB_TIME=now" \
|
-e "CRONTAB_TIME=now" \
|
||||||
-e "SIGNATURE_SPOOFING=restricted" \
|
-e "SIGNATURE_SPOOFING=restricted" \
|
||||||
-e "CUSTOM_PACKAGES=GmsCore GsfProxy FakeStore FDroid FDroidPrivilegedExtension MozillaNlpBackend NominatimNlpBackend com.google.android.maps.jar" \
|
-e "CUSTOM_PACKAGES=GmsCore GsfProxy FakeStore FDroid FDroidPrivilegedExtension MozillaNlpBackend NominatimNlpBackend com.google.android.maps.jar" \
|
||||||
@ -120,6 +118,44 @@ docker run \
|
|||||||
-v "/home/user/lineage_scripts:/srv/userscripts" \
|
-v "/home/user/lineage_scripts:/srv/userscripts" \
|
||||||
lineageos4microg/docker-lineage-cicd
|
lineageos4microg/docker-lineage-cicd
|
||||||
```
|
```
|
||||||
|
### Multiple devices, multiple branches
|
||||||
|
Specify the branches and the devices in the corresponding variables, separated by a comma.
|
||||||
|
|
||||||
|
This example is the build script used for [LineageOS for microG](https://lineage.microg.org), which has integrated microG apps and F-Droid (with F-Droid Privileged Extension).
|
||||||
|
```
|
||||||
|
docker run \
|
||||||
|
--name=lineage-$(date +%Y%m%d_%H%M) \
|
||||||
|
--cap-add=SYS_ADMIN \
|
||||||
|
-d \
|
||||||
|
-e "USER_NAME=John Doe" \
|
||||||
|
-e "USER_MAIL=john.doe@awesome.email" \
|
||||||
|
-e "WITH_SU=false" \
|
||||||
|
-e "INCLUDE_PROPRIETARY=true" \
|
||||||
|
-e "RELEASE_TYPE=microG" \
|
||||||
|
-e "BRANCH_NAME=cm-13.0,cm-14.1" \
|
||||||
|
-e "DEVICE_LIST_CM_13_0=$DEVICES_CM13_0" \
|
||||||
|
-e "DEVICE_LIST_CM_14_1=$DEVICES_CM14_1" \
|
||||||
|
-e "OTA_URL=https://api.lineage.microg.org" \
|
||||||
|
-e "CRONTAB_TIME=now" \
|
||||||
|
-e "SIGNATURE_SPOOFING=restricted" \
|
||||||
|
-e "CUSTOM_PACKAGES=GmsCore GsfProxy FakeStore FDroid FDroidPrivilegedExtension MozillaNlpBackend NominatimNlpBackend com.google.android.maps.jar" \
|
||||||
|
-e "SIGN_BUILDS=true" \
|
||||||
|
-e "CLEAN_OUTDIR=false" \
|
||||||
|
-e "CLEAN_AFTER_BUILD=true" \
|
||||||
|
-e "ZIP_SUBDIR=true" \
|
||||||
|
-e "LOGS_SUBDIR=true" \
|
||||||
|
-e "DELETE_OLD_ZIPS=3" \
|
||||||
|
-e "DELETE_OLD_LOGS=3" \
|
||||||
|
-e "CCACHE_SIZE=540G" \
|
||||||
|
-v "/home/user/cache:/srv/ccache" \
|
||||||
|
-v "/home/user/lineage:/srv/src" \
|
||||||
|
-v "/home/user/zips:/srv/zips" \
|
||||||
|
-v "/home/user/lineage_manifests:/srv/local_manifests" \
|
||||||
|
-v "/home/user/lineage_keys:/srv/keys" \
|
||||||
|
-v "/home/user/logs:/srv/logs" \
|
||||||
|
-v "/home/user/tmp:/srv/tmp" \
|
||||||
|
lineageos4microg/docker-lineage-cicd:multibranch
|
||||||
|
```
|
||||||
with the following XML in local_manifests
|
with the following XML in local_manifests
|
||||||
```
|
```
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
28
apt_preferences
Normal file
28
apt_preferences
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
Package: *
|
||||||
|
Pin: release n=experimental
|
||||||
|
Pin-Priority: -1
|
||||||
|
|
||||||
|
Package: *
|
||||||
|
Pin: release n=sid
|
||||||
|
Pin-Priority: -1
|
||||||
|
|
||||||
|
Package: openjdk-7-jdk
|
||||||
|
Pin: release n=experimental
|
||||||
|
Pin-Priority: 500
|
||||||
|
|
||||||
|
Package: openjdk-7-jre
|
||||||
|
Pin: release n=experimental
|
||||||
|
Pin-Priority: 500
|
||||||
|
|
||||||
|
Package: openjdk-7-jre-headless
|
||||||
|
Pin: release n=experimental
|
||||||
|
Pin-Priority: 500
|
||||||
|
|
||||||
|
Package: libfontconfig1
|
||||||
|
Pin: release n=sid
|
||||||
|
Pin-Priority: 500
|
||||||
|
|
||||||
|
Package: fontconfig-config
|
||||||
|
Pin: release n=sid
|
||||||
|
Pin-Priority: 500
|
||||||
|
|
465
src/build.sh
465
src/build.sh
@ -17,222 +17,313 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
if ! [ -z "$DEVICE_LIST" ]; then
|
IFS=','
|
||||||
|
shopt -s dotglob
|
||||||
|
|
||||||
# cd to working directory
|
# cd to working directory
|
||||||
cd $SRC_DIR
|
cd $SRC_DIR
|
||||||
|
|
||||||
if [ -f /root/userscripts/begin.sh ]; then
|
if [ -f /root/userscripts/begin.sh ]; then
|
||||||
echo ">> [$(date)] Running begin.sh"
|
echo ">> [$(date)] Running begin.sh"
|
||||||
/root/userscripts/begin.sh
|
/root/userscripts/begin.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If the source directory is empty
|
# If requested, clean the OUT dir in order to avoid clutter
|
||||||
if ! [ "$(ls -A $SRC_DIR)" ]; then
|
if [ "$CLEAN_OUTDIR" = true ]; then
|
||||||
# Initialize repository
|
echo ">> [$(date)] Cleaning '$ZIP_DIR'"
|
||||||
echo ">> [$(date)] Initializing repository"
|
rm $ZIP_DIR/*
|
||||||
yes | repo init -u https://github.com/lineageos/android.git -b ${BRANCH_NAME:-cm-14.1}
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
# Copy local manifests to the appropriate folder in order take them into consideration
|
# Treat DEVICE_LIST as DEVICE_LIST_<first_branch>
|
||||||
echo ">> [$(date)] Copying '$LMANIFEST_DIR/*.xml' to '$SRC_DIR/.repo/local_manifests/'"
|
first_branch=$(cut -d ',' -f 1 <<< $BRANCH_NAME)
|
||||||
rsync -a --delete --exclude 'roomservice.xml' --include '*.xml' --exclude '*' $LMANIFEST_DIR/ $SRC_DIR/.repo/local_manifests/
|
if [ ! -z "$DEVICE_LIST" ]; then
|
||||||
|
device_list_first_branch="DEVICE_LIST_$(sed 's/[^[:alnum:]]/_/g' <<< $first_branch)"
|
||||||
|
device_list_first_branch=${device_list_first_branch^^}
|
||||||
|
read $device_list_first_branch <<< "$DEVICE_LIST,${!device_list_first_branch}"
|
||||||
|
fi
|
||||||
|
|
||||||
# Reset the current git status of "vendor/cm" (remove previous changes) if the directory exists
|
# If needed, migrate from the old SRC_DIR structure
|
||||||
if [ -d "vendor/cm" ]; then
|
if [ -d $SRC_DIR/.repo ]; then
|
||||||
cd vendor/cm
|
echo ">> [$(date)] Removing old repository"
|
||||||
git reset -q --hard
|
rm -rf $SRC_DIR/*
|
||||||
cd $SRC_DIR
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
# Reset the current git status of "frameworks/base" (remove previous changes) if the directory exists
|
mkdir -p $TMP_DIR/device
|
||||||
if [ -d "frameworks/base" ]; then
|
mkdir -p $TMP_DIR/workdir
|
||||||
cd frameworks/base
|
mkdir -p $TMP_DIR/merged
|
||||||
git reset -q --hard
|
|
||||||
cd $SRC_DIR
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Sync the source code
|
mkdir -p $SRC_DIR/mirror
|
||||||
echo ">> [$(date)] Syncing repository"
|
cd $SRC_DIR/mirror
|
||||||
builddate=$(date +%Y%m%d)
|
|
||||||
repo sync -q
|
|
||||||
|
|
||||||
# If needed, apply the MicroG's signature spoofing patch
|
if [ ! -d .repo ]; then
|
||||||
if [ "$SIGNATURE_SPOOFING" = "yes" ] || [ "$SIGNATURE_SPOOFING" = "restricted" ]; then
|
echo ">> [$(date)] Initializing mirror repository"
|
||||||
# Determine which patch should be applied to the current Android source tree
|
yes | repo init -q -u https://github.com/LineageOS/mirror --mirror --no-clone-bundle -p linux
|
||||||
patch_name=""
|
fi
|
||||||
android_version=$(sed -n -e 's/^\s*PLATFORM_VERSION := //p' build/core/version_defaults.mk)
|
|
||||||
case $android_version in
|
|
||||||
4.4* ) patch_name="android_frameworks_base-KK-LP.patch" ;;
|
|
||||||
5.* ) patch_name="android_frameworks_base-KK-LP.patch" ;;
|
|
||||||
6.* ) patch_name="android_frameworks_base-M.patch" ;;
|
|
||||||
7.* ) patch_name="android_frameworks_base-N.patch" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if ! [ -z $patch_name ]; then
|
# Copy local manifests to the appropriate folder in order take them into consideration
|
||||||
|
echo ">> [$(date)] Copying '$LMANIFEST_DIR/*.xml' to 'mirror/.repo/local_manifests/'"
|
||||||
|
mkdir -p .repo/local_manifests
|
||||||
|
rsync -a --delete --exclude 'roomservice.xml' --include '*.xml' --exclude '*' $LMANIFEST_DIR .repo/local_manifests/
|
||||||
|
|
||||||
|
if [ "$INCLUDE_PROPRIETARY" = true ]; then
|
||||||
|
wget -q -O .repo/local_manifests/proprietary.xml "https://raw.githubusercontent.com/TheMuppets/manifests/mirror/default.xml"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ">> [$(date)] Syncing mirror repository"
|
||||||
|
repo sync -q --no-clone-bundle
|
||||||
|
|
||||||
|
for branch in $BRANCH_NAME; do
|
||||||
|
branch_dir=$(sed 's/[^[:alnum:]]/_/g' <<< $branch)
|
||||||
|
branch_dir=${branch_dir^^}
|
||||||
|
device_list_cur_branch="DEVICE_LIST_$branch_dir"
|
||||||
|
|
||||||
|
if [ ! -z "$branch" ] && [ ! -z "${!device_list_cur_branch}" ]; then
|
||||||
|
|
||||||
|
mkdir -p $SRC_DIR/$branch_dir
|
||||||
|
cd $SRC_DIR/$branch_dir
|
||||||
|
|
||||||
|
echo ">> [$(date)] Branch: $branch"
|
||||||
|
echo ">> [$(date)] Devices: ${!device_list_cur_branch}"
|
||||||
|
|
||||||
|
# Reset the current git status of "vendor/cm" (remove previous changes) if the directory exists
|
||||||
|
if [ -d "vendor/cm" ]; then
|
||||||
|
cd vendor/cm
|
||||||
|
git reset -q --hard
|
||||||
|
cd ../..
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Reset the current git status of "frameworks/base" (remove previous changes) if the directory exists
|
||||||
|
if [ -d "frameworks/base" ]; then
|
||||||
cd frameworks/base
|
cd frameworks/base
|
||||||
if [ "$SIGNATURE_SPOOFING" = "yes" ]; then
|
git reset -q --hard
|
||||||
echo ">> [$(date)] Applying the standard signature spoofing patch ($patch_name) to frameworks/base"
|
cd ../..
|
||||||
echo ">> [$(date)] WARNING: the standard signature spoofing patch introduces a security threat"
|
fi
|
||||||
patch --quiet -p1 -i "/root/signature_spoofing_patches/$patch_name"
|
|
||||||
|
if [ ! -d .repo ]; then
|
||||||
|
echo ">> [$(date)] Initializing branch repository"
|
||||||
|
yes | repo init -q -u https://github.com/LineageOS/android.git --reference $SRC_DIR/mirror/ -b $branch
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Copy local manifests to the appropriate folder in order take them into consideration
|
||||||
|
echo ">> [$(date)] Copying '$LMANIFEST_DIR/*.xml' to '.repo/local_manifests/'"
|
||||||
|
mkdir -p .repo/local_manifests
|
||||||
|
rsync -a --delete --exclude 'roomservice.xml' --include '*.xml' --exclude '*' $LMANIFEST_DIR .repo/local_manifests/
|
||||||
|
|
||||||
|
if [ "$INCLUDE_PROPRIETARY" = true ]; then
|
||||||
|
if [[ $branch =~ .*cm\-13\.0.* ]]; then
|
||||||
|
themuppets_branch=cm-13.0
|
||||||
|
elif [[ $branch =~ .*cm-14\.1.* ]]; then
|
||||||
|
themuppets_branch=cm-14.1
|
||||||
else
|
else
|
||||||
echo ">> [$(date)] Applying the restricted signature spoofing patch (based on $patch_name) to frameworks/base"
|
themuppets_branch=cm-14.1
|
||||||
sed 's/android:protectionLevel="dangerous"/android:protectionLevel="signature|privileged"/' "/root/signature_spoofing_patches/$patch_name" | patch --quiet -p1
|
echo ">> [$(date)] Can't find a matching branch on github.com/TheMuppets, using $themuppets_branch"
|
||||||
fi
|
fi
|
||||||
git clean -q -f
|
wget -q -O .repo/local_manifests/proprietary.xml "https://raw.githubusercontent.com/TheMuppets/manifests/$themuppets_branch/muppets.xml"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ">> [$(date)] Syncing branch repository"
|
||||||
|
builddate=$(date +%Y%m%d)
|
||||||
|
repo sync -q -c
|
||||||
|
|
||||||
|
android_version=$(sed -n -e 's/^\s*PLATFORM_VERSION := //p' build/core/version_defaults.mk)
|
||||||
|
android_version_major=$(cut -d '.' -f 1 <<< $android_version)
|
||||||
|
|
||||||
|
# If needed, apply the microG's signature spoofing patch
|
||||||
|
if [ "$SIGNATURE_SPOOFING" = "yes" ] || [ "$SIGNATURE_SPOOFING" = "restricted" ]; then
|
||||||
|
# Determine which patch should be applied to the current Android source tree
|
||||||
|
patch_name=""
|
||||||
|
case $android_version in
|
||||||
|
4.4* ) patch_name="android_frameworks_base-KK-LP.patch" ;;
|
||||||
|
5.* ) patch_name="android_frameworks_base-KK-LP.patch" ;;
|
||||||
|
6.* ) patch_name="android_frameworks_base-M.patch" ;;
|
||||||
|
7.* ) patch_name="android_frameworks_base-N.patch" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if ! [ -z $patch_name ]; then
|
||||||
|
cd frameworks/base
|
||||||
|
if [ "$SIGNATURE_SPOOFING" = "yes" ]; then
|
||||||
|
echo ">> [$(date)] Applying the standard signature spoofing patch ($patch_name) to frameworks/base"
|
||||||
|
echo ">> [$(date)] WARNING: the standard signature spoofing patch introduces a security threat"
|
||||||
|
patch --quiet -p1 -i "/root/signature_spoofing_patches/$patch_name"
|
||||||
|
else
|
||||||
|
echo ">> [$(date)] Applying the restricted signature spoofing patch (based on $patch_name) to frameworks/base"
|
||||||
|
sed 's/android:protectionLevel="dangerous"/android:protectionLevel="signature|privileged"/' "/root/signature_spoofing_patches/$patch_name" | patch --quiet -p1
|
||||||
|
fi
|
||||||
|
git clean -q -f
|
||||||
|
cd ../..
|
||||||
|
else
|
||||||
|
echo ">> [$(date)] ERROR: can't find a suitable signature spoofing patch for the current Android version ($android_version)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ">> [$(date)] Setting \"$RELEASE_TYPE\" as release type"
|
||||||
|
sed -i '/#.*Filter out random types/d' vendor/cm/config/common.mk
|
||||||
|
sed -i '/$(filter .*$(CM_BUILDTYPE)/,+3d' vendor/cm/config/common.mk
|
||||||
|
|
||||||
|
# Set a custom updater URI if a OTA URL is provided
|
||||||
|
if ! [ -z "$OTA_URL" ]; then
|
||||||
|
echo ">> [$(date)] Adding OTA URL '$OTA_URL' to build.prop"
|
||||||
|
sed -i "1s;^;PRODUCT_PROPERTY_OVERRIDES += $OTA_PROP=$OTA_URL\n\n;" vendor/cm/config/common.mk
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Add custom packages to be installed
|
||||||
|
if ! [ -z "$CUSTOM_PACKAGES" ]; then
|
||||||
|
echo ">> [$(date)] Adding custom packages ($CUSTOM_PACKAGES)"
|
||||||
|
sed -i "1s;^;PRODUCT_PACKAGES += $CUSTOM_PACKAGES\n\n;" vendor/cm/config/common.mk
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$SIGN_BUILDS" = true ]; then
|
||||||
|
echo ">> [$(date)] Adding keys path ($KEYS_DIR)"
|
||||||
|
sed -i "1s;^;PRODUCT_DEFAULT_DEV_CERTIFICATE := $KEYS_DIR/releasekey\nPRODUCT_OTA_PUBLIC_KEYS := $KEYS_DIR/releasekey\nPRODUCT_EXTRA_RECOVERY_KEYS := $KEYS_DIR/releasekey\n\n;" vendor/cm/config/common.mk
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$android_version_major" -ge "7" ]; then
|
||||||
|
jdk_version=8
|
||||||
|
elif [ "$android_version_major" -ge "5" ]; then
|
||||||
|
jdk_version=7
|
||||||
else
|
else
|
||||||
echo ">> [$(date)] ERROR: can't find a suitable signature spoofing patch for the current Android version ($android_version)"
|
echo ">> [$(date)] ERROR: $branch requires a JDK version too old (< 7); aborting"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
cd $SRC_DIR
|
|
||||||
|
|
||||||
# If requested, clean the OUT dir in order to avoid clutter
|
echo ">> [$(date)] Using OpenJDK $jdk_version"
|
||||||
if [ "$CLEAN_OUTDIR" = true ]; then
|
update-java-alternatives -s java-1.$jdk_version.0-openjdk-amd64 > /dev/null 2>&1
|
||||||
echo ">> [$(date)] Cleaning '$ZIP_DIR'"
|
|
||||||
cd $ZIP_DIR
|
|
||||||
rm *
|
|
||||||
cd $SRC_DIR
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Prepare the environment
|
# Prepare the environment
|
||||||
echo ">> [$(date)] Preparing build environment"
|
echo ">> [$(date)] Preparing build environment"
|
||||||
source build/envsetup.sh > /dev/null
|
source build/envsetup.sh > /dev/null
|
||||||
|
|
||||||
echo ">> [$(date)] Setting \"$RELEASE_TYPE\" as release type"
|
if [ -f /root/userscripts/before.sh ]; then
|
||||||
sed -i '/#.*Filter out random types/d' vendor/cm/config/common.mk
|
echo ">> [$(date)] Running before.sh"
|
||||||
sed -i '/$(filter .*$(CM_BUILDTYPE)/,+3d' vendor/cm/config/common.mk
|
/root/userscripts/before.sh
|
||||||
|
|
||||||
# Set a custom updater URI if a OTA URL is provided
|
|
||||||
if ! [ -z "$OTA_URL" ]; then
|
|
||||||
echo ">> [$(date)] Adding OTA URL '$OTA_URL' to build.prop"
|
|
||||||
sed -i "1s;^;PRODUCT_PROPERTY_OVERRIDES += $OTA_PROP=$OTA_URL\n\n;" vendor/cm/config/common.mk
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Add custom packages to be installed
|
|
||||||
if ! [ -z "$CUSTOM_PACKAGES" ]; then
|
|
||||||
echo ">> [$(date)] Adding custom packages ($CUSTOM_PACKAGES)"
|
|
||||||
sed -i "1s;^;PRODUCT_PACKAGES += $CUSTOM_PACKAGES\n\n;" vendor/cm/config/common.mk
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$SIGN_BUILDS" = true ]; then
|
|
||||||
echo ">> [$(date)] Adding keys path ($KEYS_DIR)"
|
|
||||||
sed -i "1s;^;PRODUCT_DEFAULT_DEV_CERTIFICATE := $KEYS_DIR/releasekey\nPRODUCT_OTA_PUBLIC_KEYS := $KEYS_DIR/releasekey\nPRODUCT_EXTRA_RECOVERY_KEYS := $KEYS_DIR/releasekey\n\n;" vendor/cm/config/common.mk
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f /root/userscripts/before.sh ]; then
|
|
||||||
echo ">> [$(date)] Running before.sh"
|
|
||||||
/root/userscripts/before.sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Cycle DEVICE_LIST environment variable, to know which one may be executed next
|
|
||||||
IFS=','
|
|
||||||
for codename in $DEVICE_LIST; do
|
|
||||||
currentdate=$(date +%Y%m%d)
|
|
||||||
if [ "$builddate" != "$currentdate" ]; then
|
|
||||||
# Sync the source code
|
|
||||||
echo ">> [$(date)] Syncing repository"
|
|
||||||
builddate=$currentdate
|
|
||||||
repo sync -q
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! [ -z "$codename" ]; then
|
for codename in ${!device_list_cur_branch}; do
|
||||||
if [ "$ZIP_SUBDIR" = true ]; then
|
if ! [ -z "$codename" ]; then
|
||||||
zipsubdir=$codename
|
|
||||||
mkdir -p $ZIP_DIR/$zipsubdir
|
|
||||||
else
|
|
||||||
zipsubdir=
|
|
||||||
fi
|
|
||||||
if [ "$LOGS_SUBDIR" = true ]; then
|
|
||||||
logsubdir=$codename
|
|
||||||
mkdir -p $LOGS_DIR/$logsubdir
|
|
||||||
else
|
|
||||||
logsubdir=
|
|
||||||
fi
|
|
||||||
los_ver_major=$(sed -n -e 's/^\s*PRODUCT_VERSION_MAJOR = //p' vendor/cm/config/common.mk)
|
|
||||||
los_ver_minor=$(sed -n -e 's/^\s*PRODUCT_VERSION_MINOR = //p' vendor/cm/config/common.mk)
|
|
||||||
DEBUG_LOG="$LOGS_DIR/$logsubdir/lineage-$los_ver_major.$los_ver_minor-$builddate-$RELEASE_TYPE-$codename.log"
|
|
||||||
|
|
||||||
if [ -f /root/userscripts/pre-build.sh ]; then
|
|
||||||
echo ">> [$(date)] Running pre-build.sh for $codename" >> $DEBUG_LOG 2>&1
|
|
||||||
/root/userscripts/pre-build.sh $codename >> $DEBUG_LOG 2>&1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Start the build
|
|
||||||
echo ">> [$(date)] Starting build for $codename" | tee -a $DEBUG_LOG
|
|
||||||
if brunch $codename >> $DEBUG_LOG 2>&1; then
|
|
||||||
currentdate=$(date +%Y%m%d)
|
currentdate=$(date +%Y%m%d)
|
||||||
if [ "$builddate" != "$currentdate" ]; then
|
if [ "$builddate" != "$currentdate" ]; then
|
||||||
find out/target/product/$codename -name "lineage-*-$currentdate-*.zip*" -type f -maxdepth 1 -exec sh /root/fix_build_date.sh {} $currentdate $builddate \; >> $DEBUG_LOG 2>&1
|
# Sync the source code
|
||||||
|
echo ">> [$(date)] Syncing mirror repository"
|
||||||
|
builddate=$currentdate
|
||||||
|
cd $SRC_DIR/mirror
|
||||||
|
repo sync -q --no-clone-bundle
|
||||||
|
echo ">> [$(date)] Syncing branch repository"
|
||||||
|
cd $TMP_DIR/$branch_dir
|
||||||
|
repo sync -q -c
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$BUILD_DELTA" = true ]; then
|
mount -t overlay overlay -o lowerdir=$SRC_DIR/$branch_dir,upperdir=$TMP_DIR/device,workdir=$TMP_DIR/workdir $TMP_DIR/merged
|
||||||
if [ -d "$SRC_DIR/delta_last/$codename/" ]; then
|
cd $TMP_DIR/merged
|
||||||
# If not the first build, create delta files
|
|
||||||
echo ">> [$(date)] Generating delta files for $codename" | tee -a $DEBUG_LOG
|
if [ "$ZIP_SUBDIR" = true ]; then
|
||||||
cd /root/delta
|
zipsubdir=$codename
|
||||||
if ./opendelta.sh $codename >> $DEBUG_LOG 2>&1; then
|
mkdir -p $ZIP_DIR/$zipsubdir
|
||||||
echo ">> [$(date)] Delta generation for $codename completed" | tee -a $DEBUG_LOG
|
else
|
||||||
else
|
zipsubdir=
|
||||||
echo ">> [$(date)] Delta generation for $codename failed" | tee -a $DEBUG_LOG
|
fi
|
||||||
fi
|
if [ "$LOGS_SUBDIR" = true ]; then
|
||||||
if [ "$DELETE_OLD_DELTAS" -gt "0" ]; then
|
logsubdir=$codename
|
||||||
/usr/bin/python /root/clean_up.py -n $DELETE_OLD_DELTAS $DELTA_DIR >> $DEBUG_LOG 2>&1
|
mkdir -p $LOGS_DIR/$logsubdir
|
||||||
fi
|
else
|
||||||
else
|
logsubdir=
|
||||||
# If the first build, copy the current full zip in $SRC_DIR/delta_last/$codename/
|
fi
|
||||||
echo ">> [$(date)] No previous build for $codename; using current build as base for the next delta" | tee -a $DEBUG_LOG
|
los_ver_major=$(sed -n -e 's/^\s*PRODUCT_VERSION_MAJOR = //p' vendor/cm/config/common.mk)
|
||||||
mkdir -p $SRC_DIR/delta_last/$codename/ >> $DEBUG_LOG 2>&1
|
los_ver_minor=$(sed -n -e 's/^\s*PRODUCT_VERSION_MINOR = //p' vendor/cm/config/common.mk)
|
||||||
find out/target/product/$codename -name 'lineage-*.zip' -type f -maxdepth 1 -exec cp {} $SRC_DIR/delta_last/$codename/ \; >> $DEBUG_LOG 2>&1
|
DEBUG_LOG="$LOGS_DIR/$logsubdir/lineage-$los_ver_major.$los_ver_minor-$builddate-$RELEASE_TYPE-$codename.log"
|
||||||
|
|
||||||
|
if [ -f /root/userscripts/pre-build.sh ]; then
|
||||||
|
echo ">> [$(date)] Running pre-build.sh for $codename" >> $DEBUG_LOG 2>&1
|
||||||
|
/root/userscripts/pre-build.sh $codename >> $DEBUG_LOG 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Start the build
|
||||||
|
echo ">> [$(date)] Starting build for $codename, $branch branch" | tee -a $DEBUG_LOG
|
||||||
|
if brunch $codename >> $DEBUG_LOG 2>&1; then
|
||||||
|
currentdate=$(date +%Y%m%d)
|
||||||
|
if [ "$builddate" != "$currentdate" ]; then
|
||||||
|
find out/target/product/$codename -name "lineage-*-$currentdate-*.zip*" -type f -maxdepth 1 -exec sh /root/fix_build_date.sh {} $currentdate $builddate \; >> $DEBUG_LOG 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$BUILD_DELTA" = true ]; then
|
||||||
|
if [ -d "delta_last/$codename/" ]; then
|
||||||
|
# If not the first build, create delta files
|
||||||
|
echo ">> [$(date)] Generating delta files for $codename" | tee -a $DEBUG_LOG
|
||||||
|
cd /root/delta
|
||||||
|
if ./opendelta.sh $codename >> $DEBUG_LOG 2>&1; then
|
||||||
|
echo ">> [$(date)] Delta generation for $codename completed" | tee -a $DEBUG_LOG
|
||||||
|
else
|
||||||
|
echo ">> [$(date)] Delta generation for $codename failed" | tee -a $DEBUG_LOG
|
||||||
|
fi
|
||||||
|
if [ "$DELETE_OLD_DELTAS" -gt "0" ]; then
|
||||||
|
/usr/bin/python /root/clean_up.py -n $DELETE_OLD_DELTAS $DELTA_DIR >> $DEBUG_LOG 2>&1
|
||||||
|
fi
|
||||||
|
cd $TMP_DIR/merged
|
||||||
|
else
|
||||||
|
# If the first build, copy the current full zip in $SRC_DIR/merged/delta_last/$codename/
|
||||||
|
echo ">> [$(date)] No previous build for $codename; using current build as base for the next delta" | tee -a $DEBUG_LOG
|
||||||
|
mkdir -p delta_last/$codename/ >> $DEBUG_LOG 2>&1
|
||||||
|
find out/target/product/$codename -name 'lineage-*.zip' -type f -maxdepth 1 -exec cp {} $SRC_DIR/merged/delta_last/$codename/ \; >> $DEBUG_LOG 2>&1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# Move produced ZIP files to the main OUT directory
|
||||||
|
echo ">> [$(date)] Moving build artifacts for $codename to '$ZIP_DIR/$zipsubdir'" | tee -a $DEBUG_LOG
|
||||||
|
cd out/target/product/$codename
|
||||||
|
for build in lineage-*.zip; do
|
||||||
|
sha256sum $build > $ZIP_DIR/$zipsubdir/$build.sha256sum
|
||||||
|
done
|
||||||
|
find . -name 'lineage-*.zip*' -type f -maxdepth 1 -exec mv {} $ZIP_DIR/$zipsubdir/ \; >> $DEBUG_LOG 2>&1
|
||||||
|
cd $TMP_DIR/merged
|
||||||
|
else
|
||||||
|
echo ">> [$(date)] Failed build for $codename" | tee -a $DEBUG_LOG
|
||||||
fi
|
fi
|
||||||
# Move produced ZIP files to the main OUT directory
|
|
||||||
echo ">> [$(date)] Moving build artifacts for $codename to '$ZIP_DIR/$zipsubdir'" | tee -a $DEBUG_LOG
|
|
||||||
cd $SRC_DIR/out/target/product/$codename
|
|
||||||
for build in lineage-*.zip; do
|
|
||||||
sha256sum $build > $ZIP_DIR/$zipsubdir/$build.sha256sum
|
|
||||||
done
|
|
||||||
find . -name 'lineage-*.zip*' -type f -maxdepth 1 -exec mv {} $ZIP_DIR/$zipsubdir/ \; >> $DEBUG_LOG 2>&1
|
|
||||||
cd $SRC_DIR
|
|
||||||
else
|
|
||||||
echo ">> [$(date)] Failed build for $codename" | tee -a $DEBUG_LOG
|
|
||||||
fi
|
|
||||||
# Remove old zips and logs
|
|
||||||
if [ "$DELETE_OLD_ZIPS" -gt "0" ]; then
|
|
||||||
/usr/bin/python /root/clean_up.py -n $DELETE_OLD_ZIPS $ZIP_DIR
|
|
||||||
fi
|
|
||||||
if [ "$DELETE_OLD_LOGS" -gt "0" ]; then
|
|
||||||
/usr/bin/python /root/clean_up.py -n $DELETE_OLD_LOGS $LOGS_DIR
|
|
||||||
fi
|
|
||||||
# Clean everything, in order to start fresh on next build
|
|
||||||
if [ "$CLEAN_AFTER_BUILD" = true ]; then
|
|
||||||
echo ">> [$(date)] Cleaning build for $codename" | tee -a $DEBUG_LOG
|
|
||||||
rm -rf $SRC_DIR/out/target/product/$codename/ >> $DEBUG_LOG 2>&1
|
|
||||||
fi
|
|
||||||
if [ -f /root/userscripts/post-build.sh ]; then
|
|
||||||
echo ">> [$(date)] Running post-build.sh for $codename" >> $DEBUG_LOG 2>&1
|
|
||||||
/root/userscripts/post-build.sh $codename >> $DEBUG_LOG 2>&1
|
|
||||||
fi
|
|
||||||
echo ">> [$(date)] Finishing build for $codename" | tee -a $DEBUG_LOG
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Create the OpenDelta's builds JSON file
|
# Remove old zips and logs
|
||||||
if ! [ -z "$OPENDELTA_BUILDS_JSON" ]; then
|
if [ "$DELETE_OLD_ZIPS" -gt "0" ]; then
|
||||||
echo ">> [$(date)] Creating OpenDelta's builds JSON file (ZIP_DIR/$OPENDELTA_BUILDS_JSON)"
|
/usr/bin/python /root/clean_up.py -n $DELETE_OLD_ZIPS $ZIP_DIR
|
||||||
if [ "$ZIP_SUBDIR" != true ]; then
|
fi
|
||||||
echo ">> [$(date)] WARNING: OpenDelta requires zip builds separated per device! You should set ZIP_SUBDIR to true"
|
if [ "$DELETE_OLD_LOGS" -gt "0" ]; then
|
||||||
fi
|
/usr/bin/python /root/clean_up.py -n $DELETE_OLD_LOGS $LOGS_DIR
|
||||||
/usr/bin/python /root/opendelta_builds_json.py $ZIP_DIR -o $ZIP_DIR/$OPENDELTA_BUILDS_JSON
|
fi
|
||||||
fi
|
# Clean everything, in order to start fresh on next build
|
||||||
|
if [ "$CLEAN_AFTER_BUILD" = true ]; then
|
||||||
|
echo ">> [$(date)] Cleaning build for $codename" | tee -a $DEBUG_LOG
|
||||||
|
rm -rf $SRC_DIR/merged/out/target/product/$codename/ >> $DEBUG_LOG 2>&1
|
||||||
|
fi
|
||||||
|
if [ -f /root/userscripts/post-build.sh ]; then
|
||||||
|
echo ">> [$(date)] Running post-build.sh for $codename" >> $DEBUG_LOG 2>&1
|
||||||
|
/root/userscripts/post-build.sh $codename >> $DEBUG_LOG 2>&1
|
||||||
|
fi
|
||||||
|
echo ">> [$(date)] Finishing build for $codename" | tee -a $DEBUG_LOG
|
||||||
|
|
||||||
# Clean the src directory if requested
|
cd $TMP_DIR
|
||||||
if [ "$CLEAN_SRCDIR" = true ]; then
|
umount $TMP_DIR/merged
|
||||||
rm -rf "$SRC_DIR/*"
|
echo ">> [$(date)] Cleaning source dir for device $codename"
|
||||||
fi
|
rm -rf device/*
|
||||||
|
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
if [ -f /root/userscripts/end.sh ]; then
|
|
||||||
echo ">> [$(date)] Running end.sh"
|
|
||||||
/root/userscripts/end.sh
|
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Create the OpenDelta's builds JSON file
|
||||||
|
if ! [ -z "$OPENDELTA_BUILDS_JSON" ]; then
|
||||||
|
echo ">> [$(date)] Creating OpenDelta's builds JSON file (ZIP_DIR/$OPENDELTA_BUILDS_JSON)"
|
||||||
|
if [ "$ZIP_SUBDIR" != true ]; then
|
||||||
|
echo ">> [$(date)] WARNING: OpenDelta requires zip builds separated per device! You should set ZIP_SUBDIR to true"
|
||||||
|
fi
|
||||||
|
/usr/bin/python /root/opendelta_builds_json.py $ZIP_DIR -o $ZIP_DIR/$OPENDELTA_BUILDS_JSON
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Clean the src directory if requested
|
||||||
|
if [ "$CLEAN_SRCDIR" = true ]; then
|
||||||
|
rm -rf "$SRC_DIR/*"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f /root/userscripts/end.sh ]; then
|
||||||
|
echo ">> [$(date)] Running end.sh"
|
||||||
|
/root/userscripts/end.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user