FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
asdf-java/update_data.bash at master · halcyon/asdf-java · GitHub
halcyon
/
asdf-java
Public
Notifications
You must be signed in to change notification settings
Fork
105
Star
567
Code
Issues
66
Pull requests
18
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
asdf-java
/
update_data.bash
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
62 lines (52 loc) · 1.74 KB
Breadcrumbs
asdf-java
/
update_data.bash
Copy path
File metadata and controls
executable file
·
62 lines (52 loc) · 1.74 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#!
/usr/bin/env bash
set
-e
set
-Euo pipefail
#
See https://joschi.github.io/java-metadata/ for supported values
LIST_OS=
"
linux macosx
"
LIST_ARCH=
"
x86_64 aarch64 arm32-vfp-hflt
"
LIST_RELEASE_TYPE=
"
ga ea
"
DATA_DIR=
"
./data
"
if
[[
!
-d
"
${DATA_DIR}
"
]]
then
mkdir
"
${DATA_DIR}
"
fi
function
metadata_url
{
local
os=
$1
local
arch=
$2
local
release=
$3
echo
"
https://joschi.github.io/java-metadata/metadata/
${release}
/
${os}
/
${arch}
.json
"
}
function
fetch_metadata
{
local
os=
$1
local
arch=
$2
local
release=
$3
local
args=(
'
-s
'
'
-f
'
'
--compressed
'
'
-H
'
"
Accept: application/json
"
)
if
[[
-n
"
${GITHUB_API_TOKEN
:-
}
"
]]
;
then
args+=(
'
-H
'
"
Authorization: token
$GITHUB_API_TOKEN
"
)
fi
local
url
url=
$(
metadata_url
"
$os
"
"
$arch
"
"
$release
"
)
curl
"
${args[@]}
"
-o
"
${DATA_DIR}
/jdk-
${os}
-
${arch}
-
${release}
.json
"
"
${url}
"
}
for
OS
in
$LIST_OS
do
for
ARCH
in
$LIST_ARCH
do
for
RELEASE_TYPE
in
$LIST_RELEASE_TYPE
do
fetch_metadata
"
$OS
"
"
$ARCH
"
"
$RELEASE_TYPE
"
done
cat
"
${DATA_DIR}
/jdk-
${OS}
-
${ARCH}
"
-
*
.json
|
jq -s
'
add
'
>
"
${DATA_DIR}
/jdk-
${OS}
-
${ARCH}
-all.json
"
ln -s
"
jdk-
${OS}
-
${ARCH}
-ga.json
"
"
${DATA_DIR}
/jdk-
${OS}
-
${ARCH}
.json
"
done
done
RELEASE_QUERY=
'
.[]
| select(.file_type | IN("tar.gz", "tgz", "zip"))
| .["features"] = (.features | map(select(IN("musl", "javafx", "lite", "large_heap", "certified", "crac", "fiber"))))
| [([.vendor, if (.image_type == "jre") then .image_type else empty end, if (.jvm_impl == "openj9") then .jvm_impl else empty end, if ((.features | length) == 0) then empty else (.features | join("-")) end, .version] | join("-")), .filename, .url, .sha256]
| @tsv
'
for
FILE
in
"
${DATA_DIR}
"
/
*
.json
do
TSV_FILE=
"
$(
basename
"
${FILE}
"
.json
)
.tsv
"
jq -r
"
${RELEASE_QUERY}
"
"
${FILE}
"
|
sort -V
>
"
${DATA_DIR}
/
${TSV_FILE}
"
done
Back
|
FazBrowse Home
|
New Git URL