Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
24072bed
Commit
24072bed
authored
Jun 25, 2020
by
dreis2211
Committed by
Andy Wilkinson
Jul 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve error handling in JDK upgrade checks
See gh-22110
parent
bca5ef4a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
detect-jdk-updates.sh
ci/scripts/detect-jdk-updates.sh
+20
-2
No files found.
ci/scripts/detect-jdk-updates.sh
View file @
24072bed
#!/bin/bash
#!/bin/bash
report_error
()
{
echo
"Script exited with error
$1
on line
$2
"
exit
1
;
}
trap
'report_error $? $LINENO'
ERR
case
"
$JDK_VERSION
"
in
case
"
$JDK_VERSION
"
in
java8
)
java8
)
BASE_URL
=
"https://api.adoptopenjdk.net/v3/assets/feature_releases/8"
BASE_URL
=
"https://api.adoptopenjdk.net/v3/assets/feature_releases/8"
...
@@ -16,6 +23,10 @@ esac
...
@@ -16,6 +23,10 @@ esac
response
=
$(
curl
-s
${
BASE_URL
}
\/
ga
\?
architecture
\=
x64
\&
heap_size
\=
normal
\&
image_type
\=
jdk
\&
jvm_impl
\=
hotspot
\&
os
\=
linux
\&
sort_order
\=
DESC
\&
vendor
\=
adoptopenjdk
)
response
=
$(
curl
-s
${
BASE_URL
}
\/
ga
\?
architecture
\=
x64
\&
heap_size
\=
normal
\&
image_type
\=
jdk
\&
jvm_impl
\=
hotspot
\&
os
\=
linux
\&
sort_order
\=
DESC
\&
vendor
\=
adoptopenjdk
)
latest
=
$(
jq
-r
'.[0].binaries[0].package.link'
<<<
"
$response
"
)
latest
=
$(
jq
-r
'.[0].binaries[0].package.link'
<<<
"
$response
"
)
if
[[
${
latest
}
=
"null"
||
${
latest
}
=
""
]]
;
then
echo
"Could not parse JDK response:
$response
"
exit
1
;
fi
current
=
$(
git-repo/ci/images/get-jdk-url.sh
${
JDK_VERSION
}
)
current
=
$(
git-repo/ci/images/get-jdk-url.sh
${
JDK_VERSION
}
)
...
@@ -24,9 +35,16 @@ if [[ $current = $latest ]]; then
...
@@ -24,9 +35,16 @@ if [[ $current = $latest ]]; then
exit
0
;
exit
0
;
fi
fi
milestone_number
=
$(
curl
-s
https://api.github.com/repos/
${
GITHUB_ORGANIZATION
}
/
${
GITHUB_REPO
}
/milestones
\?
state
\=
open | jq
-c
--arg
MILESTONE
"
$MILESTONE
"
'.[] | select(.title==$MILESTONE)'
| jq
-r
'.number'
)
milestone_response
=
$(
curl
-s
https://api.github.com/repos/
${
GITHUB_ORGANIZATION
}
/
${
GITHUB_REPO
}
/milestones
\?
state
\=
open
)
milestone_result
=
$(
jq
-r
-c
--arg
MILESTONE
"
$MILESTONE
"
'.[] | select(has("title")) | select(.title==$MILESTONE)'
<<<
"
$milestone_response
"
)
if
[[
${
milestone_result
}
=
"null"
||
${
milestone_result
}
=
""
]]
;
then
echo
"Could not parse milestone:
$milestone_response
"
exit
1
;
fi
milestone_number
=
$(
jq
-r
'.number'
<<<
"
$milestone_result
"
)
existing_tasks
=
$(
curl
-s
https://api.github.com/repos/
${
GITHUB_ORGANIZATION
}
/
${
GITHUB_REPO
}
/issues
\?
labels
\=
type
:%20task
\&
state
\=
open
\&
creator
\=
spring-buildmaster
\&
milestone
\=
${
milestone_number
}
)
existing_tasks
=
$(
curl
-s
https://api.github.com/repos/
${
GITHUB_ORGANIZATION
}
/
${
GITHUB_REPO
}
/issues
\?
labels
\=
type
:%20task
\&
state
\=
open
\&
creator
\=
spring-buildmaster
\&
milestone
\=
${
milestone_number
}
)
existing_jdk_issues
=
$(
echo
"
$existing_tasks
"
| jq
-c
--arg
TITLE
"
$ISSUE_TITLE
"
'.[] | select(.title==$TITLE)'
)
existing_jdk_issues
=
$(
jq
-r
-c
--arg
TITLE
"
$ISSUE_TITLE
"
'.[] | select(has("title")) | select(.title==$TITLE)'
<<<
"
$existing_tasks
"
)
if
[[
${
existing_jdk_issues
}
=
""
]]
;
then
if
[[
${
existing_jdk_issues
}
=
""
]]
;
then
curl
\
curl
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment