From 0cc32390fa1a6b4b08ea7f96fe425118adfd594c Mon Sep 17 00:00:00 2001 From: Nicola Corna Date: Wed, 17 May 2017 00:33:15 +0200 Subject: [PATCH] Add ZIP_SUBDIR --- Dockerfile | 3 +++ src/build.sh | 14 ++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0206e62..e5e0279 100644 --- a/Dockerfile +++ b/Dockerfile @@ -63,6 +63,9 @@ ENV CUSTOM_PACKAGES '' # Key path (from the root of the android source) ENV KEYS_DIR '' +# Move the resulting zips to $ZIP_DIR/$codename instead of $ZIP_DIR/ +ENV ZIP_SUBDIR false + # Create Volume entry points ############################ diff --git a/src/build.sh b/src/build.sh index 1a50c8a..e90fc7f 100644 --- a/src/build.sh +++ b/src/build.sh @@ -76,14 +76,20 @@ if ! [ -z "$DEVICE_LIST" ]; then IFS=',' for codename in $DEVICE_LIST; do if ! [ -z "$codename" ]; then + if [ "$ZIP_SUBDIR" = true ]; then + zipsubdir=$codename + mkdir -p $ZIP_DIR/$zipsubdir + else + zipsubdir= + fi # Start the build if [ -z "$KEYS_DIR" ]; then echo ">> [$(date)] Starting build for $codename" >> $DOCKER_LOG if brunch $codename 2>&1 >&$DEBUG_LOG; then # Move produced ZIP files to the main OUT directory - echo ">> [$(date)] Moving build artifacts for $codename to '$ZIP_DIR'" >> $DOCKER_LOG + echo ">> [$(date)] Moving build artifacts for $codename to '$ZIP_DIR/$zipsubdir'" >> $DOCKER_LOG cd $SRC_DIR - find out/target/product/$codename -name '*UNOFFICIAL*.zip*' -exec sh -c 'sha256sum {} > $ZIP_DIR/{}.sha256sum && mv {} $ZIP_DIR' \; >&$DEBUG_LOG + find out/target/product/$codename -name '*UNOFFICIAL*.zip*' -exec sh -c 'sha256sum {} > $ZIP_DIR/$zipsubdir/{}.sha256sum && mv {} $ZIP_DIR/$zipsubdir/' \; >&$DEBUG_LOG else echo ">> [$(date)] Failed build for $codename" >> $DOCKER_LOG fi @@ -99,8 +105,8 @@ if ! [ -z "$DEVICE_LIST" ]; then $SRC_DIR/out/dist/lineage_$codename-signed_target_files.zip 2>&1 >&$DEBUG_LOG && \ $SRC_DIR/build/tools/releasetools/ota_from_target_files -k $SRC_DIR/$KEYS_DIR/releasekey --block --backup=true \ $SRC_DIR/out/dist/lineage_$codename-signed_target_files.zip \ - $ZIP_DIR/lineage-14.1-$builddate-UNOFFICIAL-$codename-signed.zip 2>&1 >&$DEBUG_LOG; then - cd $ZIP_DIR + $ZIP_DIR/$zipsubdir/lineage-14.1-$builddate-UNOFFICIAL-$codename-signed.zip 2>&1 >&$DEBUG_LOG; then + cd $ZIP_DIR/$zipsubdir md5sum lineage-14.1-$builddate-UNOFFICIAL-$codename-signed.zip > lineage-14.1-$builddate-UNOFFICIAL-$codename-signed.zip.md5sum sha256sum lineage-14.1-$builddate-UNOFFICIAL-$codename-signed.zip > lineage-14.1-$builddate-UNOFFICIAL-$codename-signed.zip.sha256sum cd $SRC_DIR