diff --git a/Dockerfile b/Dockerfile index d213ba251443153fe4adaf76b28f573f1c3b8dc9..617990fd8d57a76bd271f022ace1b67f7fb437ef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -96,6 +96,10 @@ ENV RECOVERY_IMG false # Ship with Minimal Apps ENV MINIMAL_APPS false +# Force an eng build even when device name doesn't contain -eng +ENV ENG_BUILD false + + # You can optionally specify a USERSCRIPTS_DIR volume containing these scripts: # * begin.sh, run at the very beginning # * before.sh, run after the syncing and patching, before starting the builds diff --git a/Dockerfile.community b/Dockerfile.community index 8ec19d6bfe5dbf040199a773270313fccdb8cf95..1444d9c075ed352089ebbbf79abce4b4aa5046c3 100644 --- a/Dockerfile.community +++ b/Dockerfile.community @@ -105,6 +105,10 @@ ENV DELETE_OLD_ZIPS 0 # Delete old logs in $LOGS_DIR, keep only the N latest one (0 to disable) ENV DELETE_OLD_LOGS 0 +# Force an eng build even when device name doesn't contain -eng +ENV ENG_BUILD false + + # You can optionally specify a USERSCRIPTS_DIR volume containing these scripts: # * begin.sh, run at the very beginning # * before.sh, run after the syncing and patching, before starting the builds diff --git a/build-community.sh b/build-community.sh index 567720d61fab275c65d52b2f845e9d942e16b70e..32c0bf9c796ef8b3f2f7addcaf7b41dd6f4e02b5 100755 --- a/build-community.sh +++ b/build-community.sh @@ -289,7 +289,15 @@ for branch in ${BRANCH_NAME//,/ }; do echo "ANDROID_JACK_VM_ARGS=${ANDROID_JACK_VM_ARGS}" echo "Switch to Python2" ln -fs /usr/bin/python2 /usr/bin/python - if brunch $codename &>> "$DEBUG_LOG"; then + + + BRUNCH_DEVICE=${codename} + + if [ "${ENG_BUILD}" = true ]; then + BRUNCH_DEVICE=lineage_${codename}-eng + fi + + if brunch ${BRUNCH_DEVICE} &>> "$DEBUG_LOG"; then currentdate=$(date +%Y%m%d) if [ "$builddate" != "$currentdate" ]; then find out/target/product/$codename -maxdepth 1 -name "e-*-$currentdate-*.zip*" -type f -exec sh /root/fix_build_date.sh {} $currentdate $builddate \; &>> "$DEBUG_LOG" diff --git a/src/build.sh b/src/build.sh index 24bb23d57f92637c03f5a027ea7bcaa6239d9bf9..f04482547730489c7d9438b02e021626d734dd12 100755 --- a/src/build.sh +++ b/src/build.sh @@ -197,7 +197,14 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then echo "ANDROID_JACK_VM_ARGS=${ANDROID_JACK_VM_ARGS}" echo "Switch to Python2" ln -fs /usr/bin/python2 /usr/bin/python - if brunch ${DEVICE}; then + + BRUNCH_DEVICE=${DEVICE} + + if [ "${ENG_BUILD}" = true ]; then + BRUNCH_DEVICE=lineage_${DEVICE}-eng + fi + + if brunch ${BRUNCH_DEVICE}; then currentdate=$(date +%Y%m%d) if [ "$builddate" != "$currentdate" ]; then find out/target/product/${DEVICE} -maxdepth 1 -name "e-*-$currentdate-*.zip*" -type f -exec sh /root/fix_build_date.sh {} $currentdate $builddate \;