From 603e5663942debc11fe7c41948153636a6d4a5d4 Mon Sep 17 00:00:00 2001 From: Hagege Ruben <20857346+HagegeR@users.noreply.github.com> Date: Mon, 7 Apr 2025 18:59:20 +0300 Subject: [PATCH 1/3] try faster builds --- script/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/build.sh b/script/build.sh index d51f31b..8e41daa 100755 --- a/script/build.sh +++ b/script/build.sh @@ -32,8 +32,9 @@ url_prefix='https://github.com/' # Create each repo pushd "$layout_dir" for action_script in $script_dir/generated/*.sh; do - . $action_script + . $action_script & done +wait popd # List the repositories From f5d4bb0708eea59a9d0d99e8ef78369e587810ac Mon Sep 17 00:00:00 2001 From: Hagege Ruben <20857346+HagegeR@users.noreply.github.com> Date: Mon, 1 Sep 2025 14:54:55 +0300 Subject: [PATCH 2/3] do the curls in the background too --- script/internal/generate-scripts.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/internal/generate-scripts.sh b/script/internal/generate-scripts.sh index 3530c02..b850207 100755 --- a/script/internal/generate-scripts.sh +++ b/script/internal/generate-scripts.sh @@ -59,7 +59,8 @@ for json_file in $script_dir/../../config/actions/*.json; do echo "pushd ${owner}_$repo" >> "$script_file" for curl_download_command in "${curl_download_commands[@]}" do - echo "$curl_download_command" >> "$script_file" + echo "$curl_download_command &" >> "$script_file" done + echo "wait" >> "$script_file" echo "popd" >> "$script_file" done From df7fe4aa07b4cb77fbab50b67ac262cc7127d59a Mon Sep 17 00:00:00 2001 From: Hagege Ruben <20857346+HagegeR@users.noreply.github.com> Date: Mon, 1 Sep 2025 15:43:13 +0300 Subject: [PATCH 3/3] add retry and error handling in the background --- script/internal/generate-scripts.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/script/internal/generate-scripts.sh b/script/internal/generate-scripts.sh index b850207..8fff7e9 100755 --- a/script/internal/generate-scripts.sh +++ b/script/internal/generate-scripts.sh @@ -35,9 +35,9 @@ for json_file in $script_dir/../../config/actions/*.json; do branch="${split[0]}" sha="${split[1]}" - # Append curl download command - curl_download_commands+=("curl -s -S -L -o '$sha.tar.gz' 'https://api.github.com/repos/$owner/$repo/tarball/$sha'") - curl_download_commands+=("curl -s -S -L -o '$sha.zip' 'https://api.github.com/repos/$owner/$repo/zipball/$sha'") + # Append curl download command with retry and error handling + curl_download_commands+=("curl --retry 5 --retry-delay 2 --retry-max-time 60 --fail -s -S -L -o '$sha.tar.gz' 'https://api.github.com/repos/$owner/$repo/tarball/$sha' &") + curl_download_commands+=("curl --retry 5 --retry-delay 2 --retry-max-time 60 --fail -s -S -L -o '$sha.zip' 'https://api.github.com/repos/$owner/$repo/zipball/$sha' &") done # Get an array of tag info. Each item contains " " @@ -49,9 +49,9 @@ for json_file in $script_dir/../../config/actions/*.json; do tag="${split[0]}" sha="${split[1]}" - # Append curl download command - curl_download_commands+=("curl -s -S -L -o '$sha.tar.gz' 'https://api.github.com/repos/$owner/$repo/tarball/$sha'") - curl_download_commands+=("curl -s -S -L -o '$sha.zip' 'https://api.github.com/repos/$owner/$repo/zipball/$sha'") + # Append curl download command with retry and error handling + curl_download_commands+=("curl --retry 5 --retry-delay 2 --retry-max-time 60 --fail -s -S -L -o '$sha.tar.gz' 'https://api.github.com/repos/$owner/$repo/tarball/$sha' &") + curl_download_commands+=("curl --retry 5 --retry-delay 2 --retry-max-time 60 --fail -s -S -L -o '$sha.zip' 'https://api.github.com/repos/$owner/$repo/zipball/$sha' &") done # Append curl commands @@ -59,8 +59,9 @@ for json_file in $script_dir/../../config/actions/*.json; do echo "pushd ${owner}_$repo" >> "$script_file" for curl_download_command in "${curl_download_commands[@]}" do - echo "$curl_download_command &" >> "$script_file" + echo "$curl_download_command" >> "$script_file" done echo "wait" >> "$script_file" + echo "sleep 1" >> "$script_file" # Brief pause for process settlement echo "popd" >> "$script_file" done