Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gitpod): Install SDKMAN in GitHub runners and GitPod, and keep JDK versions up-to-date #121

Merged
merged 41 commits into from
Aug 3, 2024

Conversation

gounthar
Copy link
Collaborator

@gounthar gounthar commented Jul 25, 2024

Background

In issues and discussions #119 and #120, we discussed the possibility of compiling plugins before and after applying recipes. The main challenge is installing and switching between various JDK versions during this process.

Solution

This PR implements the following features:

  1. JDK Installation:

    • Adds Temurin JDKs from version 8 to 21 to the GitPod Workspace (defaulting to 17).
    • Creates scripts to install SDKMAN and Temurin JDKs 8-21 on any Linux machine.
  2. Version Management:

    • Implements an updating mechanism using updatecli to keep JDK versions current.
  3. Configuration:

Potential Usage

The Maven Invoker Library might allow us to launch a new Maven clean environment while specifying the JDK version (possibly through JAVA_HOME).

Limitations

While this setup may not be sufficient to automatically switch between installed JDKs during recipe application, it should assist developers in manually switching when migrating plugins between JDK versions (e.g., from JDK 6 to 11, or 11 to 17).

Next Steps

  1. Evaluate the effectiveness of this setup in practical plugin modernization scenarios.
  2. Explore ways to integrate automatic JDK switching during the recipe application process.
  3. Consider expanding support to non-Linux environments if needed.

Feedback and suggestions for improvement are welcome.

It's perfectly normal that the updatecli GitHub Action fails, as it tries to modify files that don't exist yet (plugin-modernizer-cli/src/main/resources/sdkman.properties) and parts of files that are not there yet (as the ARG in the Dockerfile). That issue will be solved when these changes will be part of the main branch.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

gounthar and others added 30 commits July 24, 2024 19:49
Made with ❤️️ by updatecli
…6a5fcc2b9095e453695eeef973e032c0eb40a3a631e18823

[plugins] Update the versions of the temurin installers from SDKMAN
We shall correct it later on.
Made with ❤️️ by updatecli
…7e105364b66594210ee2659045cfa3722f247066d212cf35

[plugins] Update the versions of the temurin installers from SDKMAN
@gounthar gounthar marked this pull request as ready for review July 25, 2024 10:09
@gounthar gounthar requested a review from a team as a code owner July 25, 2024 10:09
@jonesbusy
Copy link
Collaborator

Looks update cli failed. Excep that looks good on my side

@gounthar
Copy link
Collaborator Author

gounthar commented Aug 3, 2024

It is supposed to fail, as it is trying to update a file that doesn't exist yet.
Once merged, that should not happen anymore.

@gounthar gounthar merged commit 78bc728 into jenkins-infra:main Aug 3, 2024
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants