alloc limit updater: allow other repos (#1844)

Motivation:

The allocation limit updater script is handy but so far only worked for
the SwiftNIO core repo.

Modifications:

- allow the user to pass other URL prefixes and repos

Result:

Can be used for other repos
This commit is contained in:
Johannes Weiss 2021-05-04 19:15:38 +01:00 committed by GitHub
parent b27b08a828
commit c51907f551
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -4,20 +4,23 @@ set -eu
set -o pipefail
here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
url_prefix=${1-"https://ci.swiftserver.group/job/swift-nio2-swift"}
target_repo=${2-"$here/.."}
tmpdir=$(mktemp -d /tmp/.last-build_XXXXXX)
for f in 51 52 53 54 -nightly; do
echo "swift$f"
url="https://ci.swiftserver.group/job/swift-nio2-swift$f-prb/lastCompletedBuild/consoleFull"
url="$url_prefix$f-prb/lastCompletedBuild/consoleFull"
echo "$url"
curl -s "$url" | "$here/alloc-limits-from-test-output" > "$tmpdir/limits$f"
if [[ "$(wc -l < "$tmpdir/limits$f")" -lt 20 ]]; then
echo >&2 "ERROR: fewer than 20 limits found, something's not right"
if [[ "$(wc -l < "$tmpdir/limits$f")" -lt 5 ]]; then
echo >&2 "ERROR: fewer than 5 limits found, something's not right"
exit 1
fi
docker_file=$(if [[ "$f" == "-nightly" ]]; then f=main; fi && ls "$here/../docker/docker-compose."*"$f"*".yaml")
docker_file=$(if [[ "$f" == "-nightly" ]]; then f=main; fi && ls "$target_repo/docker/docker-compose."*"$f"*".yaml")
echo "$docker_file"
cat "$tmpdir/limits$f"