-
Notifications
You must be signed in to change notification settings - Fork 29
/
jackson-it.sh
executable file
·54 lines (47 loc) · 1.41 KB
/
jackson-it.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash -e
function lookup_jackson_versions0() {
# TODO: paginate
curl -v -L -s "https://search.maven.org/solrsearch/select?q=g:%22com.fasterxml.jackson%22+AND+a:%22jackson-bom%22&core=gav&start=0&rows=100&wt=json" |
jq -r '[.response.docs | .[].v |
{p: split("."), v:.} |
{major:.p[0] | tonumber, minor: .p[1] | tonumber, v:.v} |
select(.major >= 2 and .minor >= 7)] |
sort_by([.major, .minor, .v]) |
.[].v' |
grep -v rc | # omit rc versions
grep -v pr | # omit pr versions
grep -v -E '[[:digit:]]{8}' # omit "snapshot" (?) versions
}
function lookup_jackson_versions() {
logfile=$(mktemp)
for _ in {1..30}; do
if lookup_jackson_versions0 2>"$logfile"; then
return 0
fi
sleep 1
done
>&2 echo "Failed to get jackson versions: "
>&2 cat "$logfile"
exit 1
}
if [ "$CI" == "" ]; then
SPLIT="cat"
else
SPLIT="circleci tests split"
fi
export SPLIT
jackson_versions=$(lookup_jackson_versions)
split_versions=$(echo "$jackson_versions" | $SPLIT)
echo "Found Jackson versions: "
echo "${jackson_versions}"
echo
echo "Testing Jackson versions in this split: "
echo "${split_versions}"
for v in ${split_versions}; do
echo
echo "Testing Jackson $v"
echo "========================================================================"
set -x
./mvnw -nsu -B -V -Dautomatter.jackson.bom.version="$v" -pl jackson surefire:test
set +x
done