-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
get-data.sh
executable file
·64 lines (56 loc) · 1.87 KB
/
get-data.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
54
55
56
57
58
59
60
61
62
63
64
VERSION=$1
if [ -z $VERSION ]; then
echo "Usage $0 version-number"
exit
fi
RELEASE_INFO=data/releases${VERSION}.json
TAG_INFO=tag${VERSION}.txt
mkdir -p data
echo "Processing: $VERSION $RELEASE_TAG"
echo "In JDK, caching tags and release information"
curl -s -X 'GET' \
"https://api.adoptium.net/v3/assets/feature_releases/$VERSION/ga?heap_size=normal&image_type=jdk&jvm_impl=hotspot&page=0&page_size=10&project=jdk&sort_method=DEFAULT&sort_order=DESC&vendor=eclipse" \
-H 'accept: application/json' > $RELEASE_INFO
echo "Fetching / Updating Git Repos"
cd data
function getrepo () {
REPONAME=$1
REPO=$2
PREFIX=$3
DIR=$(pwd)
echo "Repo is $REPO"
rm -rf $REPONAME
git init $REPONAME
cd $REPONAME
echo "Getting Tags for $REPONAME"
git config extensions.partialClone true
git remote add origin https://github.com/adoptium/$REPONAME
git fetch --filter=blob:none --tags --depth=1 origin 2>&1 | cat > /dev/null
git log --tags --simplify-by-decoration --pretty="format:%ci %d" > ../${PREFIX}$TAG_INFO
TAG_DATES=../${PREFIX}$TAG_INFO-ga-tag-dates
rm -rf $TAG_DATES
cat ../${PREFIX}$TAG_INFO | \
sed "s/tag:/\ntag:/g" | sed "s/\,/\n/g" | sed "s/)//g" | grep "tag:" | cut -d ":" -f 2 | xargs -n1 $DIR/../get-tag-date.sh >> $TAG_DATES
cd ..
git config extensions.partialClone false
#rm -rf $REPONAME
}
if [ $VERSION == 8 ]
then
REPONAME=aarch32-jdk8u
getrepo $REPONAME https://github.com/adoptium/$REPONAME "aarch32-jdk8u-"
fi
if [ $VERSION == 22 ]
then
REPONAME=jdk${VERSION}
getrepo $REPONAME https://github.com/adoptium/$REPONAME
fi
REPONAME=jdk${VERSION}u
getrepo $REPONAME https://github.com/adoptium/$REPONAME
echo
echo "Release data is in $RELEASE_INFO"
echo "tag data is in $TAG_INFO"
if [ $VERSION == 8 ]
then
echo "JDK 8 special extra is ../aarch32-jdk8u-$TAG_INFO"
fi