Skip to content

Increase Maven Connection Stability in GHA Android Builds #818

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion build_scripts/android/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ set +e
# Retry the build up to 10 times, because the build fetches files from
# maven and elsewhere, and occasionally the GitHub runners have
# network connectivity issues that cause the download to fail.
gradleparams="-Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false\
-Dmaven.wagon.httpconnectionManager.ttlSeconds=120"
for retry in {1..10} error; do
if [[ $retry == "error" ]]; then exit 5; fi
./gradlew assembleRelease && break
./gradlew assembleRelease "${gradleparams}" && break
sleep 300
done
set -e
Expand Down
3 changes: 3 additions & 0 deletions scripts/gha/build_testapps.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,9 @@ def _build_android(project_dir, sdk_dir):
gradle_properties = os.path.join(project_dir, "gradle.properties")
with open(gradle_properties, "a+") as f:
f.write("systemProp.firebase_cpp_sdk.dir=" + sdk_dir + "\n")
f.write("http.keepAlive=false\n")
f.write("maven.wagon.http.pool=false\n")
f.write("maven.wagon.httpconnectionManager.ttlSeconds=120")
# This will log the versions of dependencies for debugging purposes.
_run([gradlew, "dependencies", "--configuration", "debugCompileClasspath"])
_run([gradlew, "assembleDebug", "--stacktrace"])
Expand Down