Only download the GitHub build status repository once, and check if it exists before downloading.
Include push boolean into run_ci_on_github_repo method to indicate whether it should push once it is done (e.g. when it is only ran manually on a single repo), or if it should wait, such that a single push is done after:
echo "github_repositories=${github_repositories[@]}"
for github_repository in "${github_repositories[@]}"; do
echo "$github_repository"
run_ci_on_github_repo "$github_organisation_or_username" "$github_repository" "$github_organisation_or_username"
done
To do this, move the code:
# Verify ssh-access
#has_access="$(check_ssh_access_to_repo "$github_username" "$GITHUB_STATUS_WEBSITE_GLOBAL")"
# 8. Clone the GitHub build statusses repository.
printf " download_and_overwrite_repository_using_ssh"
download_and_overwrite_repository_using_ssh "$GITHUB_USERNAME_GLOBAL" "$GITHUB_STATUS_WEBSITE_GLOBAL" "$MIRROR_LOCATION/GitHub/$GITHUB_STATUS_WEBSITE_GLOBAL"
sleep 2
# 9. Verify the Build status repository is cloned.
manual_assert_dir_exists "$MIRROR_LOCATION/GitHub/$GITHUB_STATUS_WEBSITE_GLOBAL"
# 10. Copy the GitLab CI Build status icon to the build status repository.
# Create a folder of the repository on which a CI has been ran, inside the GitHub build status website repository, if it does not exist yet
# Also add a folder for the branch(es) of that GitLab CI repository, in that respective folder.
A bit up.
Then do the same for the run_ci_on_commit.sh file, and only push the results after all the repositories are evaluated.
Only download the GitHub build status repository once, and check if it exists before downloading. Include push boolean into
run_ci_on_github_repo
method to indicate whether it should push once it is done (e.g. when it is only ran manually on a single repo), or if it should wait, such that a single push is done after:To do this, move the code:
A bit up.
Then do the same for the
run_ci_on_commit.sh
file, and only push the results after all the repositories are evaluated.