-
Notifications
You must be signed in to change notification settings - Fork 82
Stabilize Molecule verification and RPM install workflow #712
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
Open
beri04
wants to merge
15
commits into
jenkinsci:master
Choose a base branch
from
beri04:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+83
−25
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
8108a2c
fix: stabilize Molecule + Ansible setup with Fedora-41 and local RPM …
beri04 35a5d8c
fix: remove absolute paths and use relative target volume in molecule…
beri04 7b43fb8
made so changes in build section of Jenkinsfile
beri04 0a4322b
fix: ensure RPMs copied to /var/tmp/target/rpm and clean molecule config
beri04 0833dca
fix: map Jenkins workspace target to molecule container target path
beri04 a509563
fix: prepare /var/tmp/target/rpm before molecule test
beri04 8cf9c82
added the old test cases
beri04 8ee041d
Merge branch 'master' into master
MarkEWaite b228fbe
moved the prepare molecule stage with the build stage
beri04 5685d51
moved the prepare molecule stage with the build stage
beri04 0c13f8f
Merge branch 'master' into master
MarkEWaite c168ce0
Restore original molecule.yml formatting
beri04 ccd3f22
Merge branch 'master' into master
MarkEWaite 9ef2b60
Remove hard-coded /var/tmp usage and keep build outputs
beri04 a2ddf06
Merge branch 'master' of https://github.com/beri04/packaging-java
beri04 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,41 +1,77 @@ | ||
| --- | ||
| - package: | ||
| - name: Install base dependencies | ||
| ansible.builtin.package: | ||
| name: | ||
| - fontconfig | ||
| state: present | ||
| update_cache: true | ||
| - package: | ||
| name: | ||
| - java-21-openjdk | ||
| state: present | ||
| when: ansible_distribution != 'Amazon' and (ansible_distribution != 'CentOS' or ansible_distribution_major_version != '10') | ||
| - package: | ||
| name: | ||
| - java-21-amazon-corretto | ||
|
|
||
| # Add Eclipse Temurin repo for Fedora 42+ | ||
| - name: Add Eclipse Temurin repo for Fedora 42+ | ||
| ansible.builtin.command: | ||
| cmd: dnf install -y https://packages.adoptium.net/artifactory/rpm/temurin.repo | ||
| when: | ||
| - ansible_distribution == "Fedora" | ||
| - ansible_distribution_major_version | int >= 42 | ||
|
|
||
| # Install Temurin 17 JRE for Fedora 42+ | ||
| - name: Install Temurin 17 JRE for Fedora 42+ | ||
| ansible.builtin.package: | ||
| name: temurin-17-jre | ||
| state: present | ||
| when: ansible_distribution == 'Amazon' | ||
| - package: | ||
| name: | ||
| - java-21-openjdk | ||
| when: | ||
| - ansible_distribution == "Fedora" | ||
| - ansible_distribution_major_version | int >= 42 | ||
|
|
||
| # Install Java 21 for all other distros | ||
| - name: Install Java 21 OpenJDK / Corretto | ||
| ansible.builtin.package: | ||
| name: >- | ||
| {{ | ||
| 'java-21-amazon-corretto' if ansible_distribution == 'Amazon' else | ||
| 'java-21-openjdk' | ||
| }} | ||
| state: present | ||
| when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '10' | ||
| - file: | ||
|
|
||
| # Create credentials directory | ||
| - name: Create credentials directory | ||
| ansible.builtin.file: | ||
| path: /var/tmp/target/credentials | ||
| state: directory | ||
| - copy: | ||
| mode: "0755" | ||
|
|
||
| # Copy GPG key | ||
| - name: Copy GPG key | ||
| ansible.builtin.copy: | ||
| src: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') }}/credentials/test.ascii.key" | ||
| dest: /var/tmp/target/credentials/test.ascii.key | ||
| - rpm_key: | ||
| mode: "0644" | ||
|
|
||
| # Import GPG key | ||
| - name: Import GPG key | ||
| ansible.builtin.rpm_key: | ||
| state: present | ||
| key: /var/tmp/target/credentials/test.ascii.key | ||
| - find: | ||
|
|
||
| # Find built RPM | ||
| - name: Locate built RPM package | ||
| ansible.builtin.find: | ||
| paths: /var/tmp/target/rpm | ||
| file_type: file | ||
| patterns: "*.rpm" | ||
| register: package_list | ||
| - assert: | ||
|
|
||
| # Ensure at least one RPM exists | ||
| - name: Verify RPM presence | ||
| ansible.builtin.assert: | ||
| that: | ||
| - package_list.matched == 1 | ||
| - package: | ||
| - package_list.matched >= 1 | ||
| success_msg: "Found {{ package_list.matched }} RPM(s): {{ package_list.files | map(attribute='path') | list }}" | ||
| fail_msg: "No RPM found in /var/tmp/target/rpm" | ||
|
|
||
| # Install local RPM (disable GPG check for unsigned builds) | ||
| - name: Install local RPM without GPG validation | ||
| ansible.builtin.package: | ||
| name: "{{ package_list.files[0].path }}" | ||
| state: present | ||
| disable_gpg_check: true | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why reverting the JDK major version from 21 (before) to 17?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jenkins currently supports Java 17 as the required LTS runtime, java 21 is not yet a supported runtime for Jenkins, so installing temurin 21 on fedora 42+ would be inconsistent with jenkins supported java versions.
((Once Jenkins officially supports Java 21, this can be revisited.))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Java support policy for Jenkins shows that Jenkins has supported Java 21 since November 2023. We've just dropped support for Java 17 in Jenkins weekly and will drop support for Java 17 in Jenkins LTS in April 2026.