Skip to content

Commit 6d15965

Browse files
committed
chore(stacks): change java to long time support
1 parent 124a2ef commit 6d15965

4 files changed

Lines changed: 34 additions & 59 deletions

File tree

build.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ function renew() {
7373
git push --tag
7474
}
7575

76+
function clean-tags() {
77+
for tag in $(git tag --sort creatordate|head -n "$1")
78+
do
79+
git tag -d ${tag}
80+
git push origin :refs/tags/${tag}
81+
done
82+
}
83+
7684
function all() {
7785
STACK_NAME=$(echo "${1}" | cut -d '@' -f 1)
7886
STACK_VERSION=$(echo "${1}" | cut -d '@' -f 2)

scripts/checker.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@
110110
"match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$",
111111
},
112112
"java": {
113-
"name": "jdk",
114-
"type": "github",
115-
"owner": "openjdk",
116-
"match": "^jdk-[0-9]{1,}\+[0-9]{1,}$",
113+
"url": "https://learn.microsoft.com/en-us/java/openjdk/download",
114+
"type": "url",
115+
"search": r"https://aka.ms/download-jdk/microsoft-jdk-[0-9]{1,}.[0-9]{1,}.[0-9]{1,}-linux-x64.tar.gz",
116+
"version": r"[0-9]{1,}.[0-9]{1,}.[0-9]{1,}",
117117
},
118118
"jq": {
119119
"name": "jq",
@@ -386,17 +386,30 @@ def check_github_version(stack):
386386
else:
387387
break
388388

389+
def check_url_version(stack):
390+
info = repo_info_table[stack]
391+
html = requests.get(info["url"]).text
392+
versions = set()
393+
for url in set(re.findall(info["search"], html)):
394+
match = re.search(info["version"], url)
395+
if match:
396+
versions.add(match.group())
397+
for version in versions:
398+
create_github_issue(stack, version)
399+
389400

390401
def main():
391402
for stack in os.listdir(os.path.join(os.path.dirname(__file__), "..", "stacks")):
392403
if stack not in repo_info_table:
393404
raise NotImplementedError(f"{stack} not in repo_info_table")
394405
else:
395406
repo_type = repo_info_table[stack]["type"]
396-
if repo_type != "github":
397-
raise NotImplementedError(f"{repo_type} NotImplemented")
398-
else:
407+
if repo_type == "github":
399408
check_github_version(stack)
409+
elif repo_type == 'url':
410+
check_url_version(stack)
411+
else:
412+
raise NotImplementedError(f"{repo_type} NotImplemented")
400413

401414

402415
if __name__ == "__main__":

stacks/java/build.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
# Implement build function
77
function build() {
88
generate-stack-path
9-
./make.sh
9+
case $(uname -m) in
10+
aarch64) url="https://aka.ms/download-jdk/microsoft-jdk-${STACK_VERSION}-linux-aarch64.tar.gz";;
11+
x86_64) url="https://aka.ms/download-jdk/microsoft-jdk-${STACK_VERSION}-linux-x64.tar.gz";;
12+
esac
13+
curl -sSL "${url}" | tar -xz
14+
cp -rf jdk-${STACK_VERSION}*/* "${DATA_DIR}" && rm -rf jdk-${STACK_VERSION}*
1015
mkdir -p "${DATA_DIR}"/env
1116
echo "/opt/drycc/java" > "${DATA_DIR}"/env/JAVA_HOME
1217
cat << EOF >> ${PROFILE_DIR}/${STACK_NAME}.sh

stacks/java/make.sh

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)