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 diff --git a/script/internal/generate-scripts.sh b/script/internal/generate-scripts.sh index 3530c02..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 @@ -61,5 +61,7 @@ for json_file in $script_dir/../../config/actions/*.json; do do 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