From 2262454546ef2457038603192ae460267cf233ed Mon Sep 17 00:00:00 2001 From: Romain Hunault Date: Thu, 7 Oct 2021 18:32:41 +0200 Subject: [PATCH 1/8] Backup emulator files --- Dockerfile | 3 +++ src/build.sh | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/Dockerfile b/Dockerfile index eed5b20..8326e8f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -102,6 +102,9 @@ ENV ENG_BUILD false #Save intermediate system.img even when not in out folder ENV BACKUP_INTERMEDIATE_SYSTEM_IMG false +# Backup emulator files +ENV BACKUP_EMULATOR false + # You can optionally specify a USERSCRIPTS_DIR volume containing these scripts: # * begin.sh, run at the very beginning diff --git a/src/build.sh b/src/build.sh index e494faf..69bcbac 100755 --- a/src/build.sh +++ b/src/build.sh @@ -250,6 +250,12 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then cd "${OUT}" || return 1 fi + if [ "$BACKUP_EMULATOR" = true ];then + # to remove: + ls -Rl host + mv host/linux-x86/sdk_addon/*-img.zip "$ZIP_DIR/$zipsubdir/" + fi + if [ "$RECOVERY_IMG" = true ]; then RECOVERY_IMG_NAME="recovery-${build%.*}.img" -- GitLab From f6c2447776ab7808a7b5d5aa5313e72630930f61 Mon Sep 17 00:00:00 2001 From: Romain Hunault Date: Fri, 8 Oct 2021 11:40:08 +0200 Subject: [PATCH 2/8] Use lunch command --- Dockerfile | 3 +++ src/build.sh | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8326e8f..28c92dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -105,6 +105,9 @@ ENV BACKUP_INTERMEDIATE_SYSTEM_IMG false # Backup emulator files ENV BACKUP_EMULATOR false +# Use lunch command (by default, it's brunch) +ENV USE_LUNCH false + # You can optionally specify a USERSCRIPTS_DIR volume containing these scripts: # * begin.sh, run at the very beginning diff --git a/src/build.sh b/src/build.sh index 69bcbac..bc76adf 100755 --- a/src/build.sh +++ b/src/build.sh @@ -211,10 +211,12 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then if make systemimage; then build_success=true fi - else - if brunch "${BRUNCH_DEVICE}"; then + elif [ "${USE_LUNCH}" = true ]; then + if lunch "${BRUNCH_DEVICE}"; then build_success=true fi + elif brunch "${BRUNCH_DEVICE}"; then + build_success=true fi if [ "$build_success" = true ]; then -- GitLab From 5ab5fbff1b190ea65db09d182e93d59f62eb5001 Mon Sep 17 00:00:00 2001 From: Romain Hunault Date: Fri, 8 Oct 2021 11:59:51 +0200 Subject: [PATCH 3/8] Add missing mka --- src/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build.sh b/src/build.sh index bc76adf..25df1d6 100755 --- a/src/build.sh +++ b/src/build.sh @@ -212,7 +212,7 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then build_success=true fi elif [ "${USE_LUNCH}" = true ]; then - if lunch "${BRUNCH_DEVICE}"; then + if lunch "${BRUNCH_DEVICE}" && mka ; then build_success=true fi elif brunch "${BRUNCH_DEVICE}"; then -- GitLab From fa924362c85cbfd3175a060b7c55e199f28a68db Mon Sep 17 00:00:00 2001 From: Romain Hunault Date: Fri, 8 Oct 2021 15:24:29 +0200 Subject: [PATCH 4/8] Update the build command --- src/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/build.sh b/src/build.sh index 25df1d6..47d40af 100755 --- a/src/build.sh +++ b/src/build.sh @@ -212,7 +212,7 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then build_success=true fi elif [ "${USE_LUNCH}" = true ]; then - if lunch "${BRUNCH_DEVICE}" && mka ; then + if lunch "${BRUNCH_DEVICE}" && mka && mka sdk_addon ; then build_success=true fi elif brunch "${BRUNCH_DEVICE}"; then @@ -255,6 +255,7 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then if [ "$BACKUP_EMULATOR" = true ];then # to remove: ls -Rl host + ls ${OUT} mv host/linux-x86/sdk_addon/*-img.zip "$ZIP_DIR/$zipsubdir/" fi -- GitLab From cd2cbbf3d213514832c33ef7b02b326c2f3d97a1 Mon Sep 17 00:00:00 2001 From: Romain Hunault Date: Fri, 8 Oct 2021 17:04:47 +0200 Subject: [PATCH 5/8] Display more info --- src/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build.sh b/src/build.sh index 47d40af..0d393fe 100755 --- a/src/build.sh +++ b/src/build.sh @@ -255,7 +255,7 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then if [ "$BACKUP_EMULATOR" = true ];then # to remove: ls -Rl host - ls ${OUT} + ls -Rl ${OUT} mv host/linux-x86/sdk_addon/*-img.zip "$ZIP_DIR/$zipsubdir/" fi -- GitLab From 1acbb60f71fd12265afb48a6f2906a3f18266adb Mon Sep 17 00:00:00 2001 From: Jonathan Klee Date: Thu, 18 Nov 2021 11:25:42 +0100 Subject: [PATCH 6/8] Prevent from generating empty sha256sum files when no e-*.zip files have been found. --- src/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build.sh b/src/build.sh index 0d393fe..d124189 100755 --- a/src/build.sh +++ b/src/build.sh @@ -228,7 +228,7 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then # Move produced ZIP files to the main OUT directory echo ">> [$(date)] Moving build artifacts for ${DEVICE} to '$ZIP_DIR/$zipsubdir'" cd "${OUT}" || return 1 - for build in e-*.zip; do + for build in $(ls e-*.zip); do #with only systemimage, we don't have a e-*.zip if [ "${BUILD_ONLY_SYSTEMIMAGE}" = true ]; then build=e-`grep lineage.version system/build.prop | sed s/#.*// | sed s/.*=// | tr -d \\n`.zip -- GitLab From f3e167e9eb1e5421a7091f33b30769d4588fe8bd Mon Sep 17 00:00:00 2001 From: Jonathan Klee Date: Thu, 18 Nov 2021 11:30:18 +0100 Subject: [PATCH 7/8] Add emulator archive to job artifacts --- src/build.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/build.sh b/src/build.sh index d124189..9038c00 100755 --- a/src/build.sh +++ b/src/build.sh @@ -252,13 +252,6 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then cd "${OUT}" || return 1 fi - if [ "$BACKUP_EMULATOR" = true ];then - # to remove: - ls -Rl host - ls -Rl ${OUT} - mv host/linux-x86/sdk_addon/*-img.zip "$ZIP_DIR/$zipsubdir/" - fi - if [ "$RECOVERY_IMG" = true ]; then RECOVERY_IMG_NAME="recovery-${build%.*}.img" @@ -274,6 +267,14 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then fi done + if [ "$IS_EMULATOR" = true -a "$BACKUP_EMULATOR" = true ]; then + EMULATOR_ARCHIVE="e-eng-$currentdate-linux-x86-img.zip" + mv ../../../host/linux-x86/sdk_addon/*-img.zip "$ZIP_DIR/$zipsubdir/$EMULATOR_ARCHIVE" + pushd "$ZIP_DIR/$zipsubdir" + sha256sum "$EMULATOR_ARCHIVE" > "$EMULATOR_ARCHIVE.sha256sum" + popd + fi + cd "$source_dir" || return 1 build_successful=true else -- GitLab From 43cd3ff7125b7a3222581378c0fb7b3c8215544b Mon Sep 17 00:00:00 2001 From: Jonathan Klee Date: Thu, 18 Nov 2021 17:31:41 +0100 Subject: [PATCH 8/8] Improve name adding android version --- src/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build.sh b/src/build.sh index 9038c00..b9add0c 100755 --- a/src/build.sh +++ b/src/build.sh @@ -268,7 +268,7 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then done if [ "$IS_EMULATOR" = true -a "$BACKUP_EMULATOR" = true ]; then - EMULATOR_ARCHIVE="e-eng-$currentdate-linux-x86-img.zip" + EMULATOR_ARCHIVE="e-android$android_version-eng-$currentdate-linux-x86-img.zip" mv ../../../host/linux-x86/sdk_addon/*-img.zip "$ZIP_DIR/$zipsubdir/$EMULATOR_ARCHIVE" pushd "$ZIP_DIR/$zipsubdir" sha256sum "$EMULATOR_ARCHIVE" > "$EMULATOR_ARCHIVE.sha256sum" -- GitLab