From 029f844c71e1c9a86135a3ea237db87f40acee9d Mon Sep 17 00:00:00 2001 From: Velsoth Date: Thu, 30 May 2019 20:39:02 +0100 Subject: [PATCH] Add createBuildBundle operation --- entrypoint.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index faf8e1c..66322f6 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,6 +3,9 @@ set -e build_directory="/build" +output_directory="$build_directory/out" + +date="$(date '+%Y%m%d%H%M')" function initializeSourceTree() { manifest="$1" @@ -61,6 +64,20 @@ function cleanBuild() { make clean } +function createBuildBundle() { + device="$1" + device_output_directory="$output_directory/target/product/$device" + cd "$device_output_directory" + tar \ + -C "$device_output_directory" \ + -cvf "$output_directory/$device-replicant-$date.tar.xz" \ + "boot.img" \ + "system.img" \ + "userdata.img" \ + "recovery.img" \ + replicant_*.root.zip +} + cd "$build_directory" if [ $# -eq 0 ]; then @@ -108,6 +125,12 @@ else cleanBuild ;; + -P | --package ) + device="$2" + createBuildBundle "$device" + shift + ;; + esac shift done