From d71cf9fa982ff209470c7934eee4ccde825f3b39 Mon Sep 17 00:00:00 2001 From: TheScarastic Date: Mon, 8 Aug 2022 12:55:49 +0000 Subject: [PATCH 1/2] docker-lineage-cicd: use all threads while building --- build-community.sh | 6 +++--- src/build.sh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build-community.sh b/build-community.sh index ad88f98..84d375f 100755 --- a/build-community.sh +++ b/build-community.sh @@ -66,7 +66,7 @@ if [ "$LOCAL_MIRROR" = true ]; then fi echo ">> [$(date)] Syncing mirror repository" | tee -a "$repo_log" - repo sync --force-sync --no-clone-bundle &>> "$repo_log" + repo sync -j$(nproc --all) --force-sync --no-clone-bundle &>> "$repo_log" if [ $? != 0 ]; then sync_successful=false @@ -163,7 +163,7 @@ for branch in ${BRANCH_NAME//,/ }; do echo ">> [$(date)] Syncing branch repository" | tee -a "$repo_log" builddate=$(date +%Y%m%d) - repo sync -c --force-sync &>> "$repo_log" + repo sync -c -j$(nproc --all) --force-sync &>> "$repo_log" if [ $? != 0 ]; then sync_successful=false @@ -235,7 +235,7 @@ for branch in ${BRANCH_NAME//,/ }; do if [ "$LOCAL_MIRROR" = true ]; then echo ">> [$(date)] Syncing mirror repository" | tee -a "$repo_log" cd "$MIRROR_DIR" - repo sync --force-sync --no-clone-bundle &>> "$repo_log" + repo sync -j$(nproc --all) --force-sync --no-clone-bundle &>> "$repo_log" if [ $? != 0 ]; then sync_successful=false diff --git a/src/build.sh b/src/build.sh index f6e3cd7..b3b56a3 100755 --- a/src/build.sh +++ b/src/build.sh @@ -119,7 +119,7 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then echo ">> [$(date)] Syncing branch repository" builddate=$(date +%Y%m%d) - repo_out=$(repo sync -c --force-sync 2>&1 > /dev/null) + repo_out=$(repo sync -c -j$(nproc --all) --force-sync 2>&1 > /dev/null) repo_status=$? echo -e $repo_out @@ -189,7 +189,7 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then cd "$SRC_DIR/$branch_dir" || return 1 - if ! repo sync -c --force-sync; then + if ! repo sync -c -j$(nproc --all) --force-sync; then sync_successful=false build_device=false fi -- GitLab From 5d9f8079591e070ffbfdaccfcce8e898f028802c Mon Sep 17 00:00:00 2001 From: TheScarastic Date: Fri, 26 Aug 2022 10:12:26 +0000 Subject: [PATCH 2/2] docker: Add s support to regex --- src/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build.sh b/src/build.sh index b3b56a3..e4fe4a4 100755 --- a/src/build.sh +++ b/src/build.sh @@ -34,7 +34,7 @@ fi sync_successful=true use_openjdk_from_ubuntu=false -branch_dir=$(sed -E 's/^v[0-9](\.[0-9]*){0,2}(-(beta|alpha|rc)(\.[0-9]*){0,1}){0,1}-(nougat|oreo|pie|q|r)(-[a-zA-Z0-9_]*)*$/\5/' <<< "${BRANCH_NAME}") +branch_dir=$(sed -E 's/^v[0-9](\.[0-9]*){0,2}(-(beta|alpha|rc)(\.[0-9]*){0,1}){0,1}-(nougat|oreo|pie|q|r|s)(-[a-zA-Z0-9_]*)*$/\5/' <<< "${BRANCH_NAME}") branch_dir=${branch_dir^^} if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then -- GitLab