Skip to content

Commit

Permalink
Switch project to JShellWrapper and use alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
surajkumar committed Sep 27, 2024
1 parent 06dd437 commit 8ff6782
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/update-jib-base-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Extract current version from JShellAPI build.gradle
gradle_file="JShellAPI/build.gradle"
gradle_file="JShellWrapper/build.gradle"
current_version=$(grep -oP "(?<=from\.image\s=\s'eclipse-temurin:)\d+" $gradle_file)
if [ -z "$current_version" ]; then
Expand All @@ -33,16 +33,17 @@ jobs:
# Fetch the latest eclipse-temurin image
latest_version=$(curl -s "https://hub.docker.com/v2/repositories/library/eclipse-temurin/tags/?page_size=100" | \
jq -r '[.results[].name | select(test("^[0-9]+"))] | map(capture("^(?<major>[0-9]+)")) | max_by(.major | tonumber) | .major')
jq -r '[.results[].name | select(test("alpine")) | select(test("^[0-9]+"))] | map(capture("^(?<major>[0-9]+)")) | max_by(.major | tonumber) | .major')

# Check if a new version is available
if [ "$latest_version" -le "$current_version" ]; then
echo "No new versions available"
exit 0
fi

# Update the build.gradle with the new version
sed -i "s/eclipse-temurin:$current_version/eclipse-temurin:$latest_version/" $gradle_file
sed -i "s/eclipse-temurin:$current_version-alpine/eclipse-temurin:$latest_version-alpine/" $gradle_file

echo "Updated eclipse-temurin version from $current_version to $latest_version"

Expand Down

0 comments on commit 8ff6782

Please sign in to comment.