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

SuSE/RPM merge specfiles and only build a single rpm for RH/SuSE #430

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

philfry
Copy link
Contributor

@philfry philfry commented Sep 7, 2023

This PR contains the following changes:

  • merge rpm and SuSE specfiles
  • remove zypper repository file, analogous to #1202
  • remove SuSE build script
  • re-add lost %dir %{_datadir}/%{name}

I'm not sure how the publishing works, though. Probably I'll need a little help here.

Testing done

# import the rpm signing key and announce it to rpm
gpg --import credentials/test.secret.gpg
echo '%_gpg_name Bogus Test (This is test only key) <[email protected]>' > ~/.rpmmacros

# remove the msi thingy
sed -i '/^export MSI/d' setup.mk

# get the war
export ver="2.414.1"
wget -c https://get.jenkins.io/war-stable/${ver}/jenkins.war

# build the rpm
WAR=${PWD}/jenkins.war make rpm BRAND=./branding/jenkins.mk BUILDENV=./env/release.mk VERSION=${ver}

# as I use podman instead of docker I needed some minor adaptions
sed -i 's/docker/podman/' requirements.txt molecule/default/molecule.yml
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

# get the dokken images
podman pull docker.io/dokken/{oraclelinux-{8,9},opensuse-leap-15}:latest

# run the tests
molecule test -p oraclelinux-8
molecule test -p oraclelinux-9
molecule test -p opensuse-leap-15
PLAY RECAP *********************************************************************
oraclelinux-8              : ok=16   changed=4    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
oraclelinux-9              : ok=10   changed=4    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0
opensuse-leap-15           : ok=16   changed=4    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

Submitter checklist

Fixes: #419

@philfry philfry requested a review from a team as a code owner September 7, 2023 07:17
Copy link
Member

@basil basil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really great! To get rid of the suse.publish target in the Makefile, the suse/publish/publish.sh script, and the SUSE_URL, SUSEDIR, and SUSE_WEBDIR environment variables, we just need to get rid of the SUSE stage from https://github.com/jenkins-infra/release/blob/8951254c4a415d24d81b8b9c351b9bb6a07408f8/Jenkinsfile.d/core/package#L226-L248 and rename the existing "Red Hat" stage to something more generic like "RPM", as well as doing the same thing in https://github.com/jenkinsci/jenkins/blob/ba4690c5a461d3c7b4f375912c6c7ff7b02323ee/.github/workflows/publish-release-artifact.yml#L177-L211. Note that while the jenkinsci/jenkins and jenkinsci/packaging repositories have unstable weekly (e.g., master) and stable LTS (e.g., stable-2.414) branches, jenkins-infra/release only has a single branch that is used for all releases, implying that for jenkins-infra/release we should either retain the SUSE stage for LTS releases but skip it on weekly releases (doable, but requires some conditional logic) or backport this PR to the stable-2.414 of jenkinsci/packaging and then remove SUSE entirely from jenkins-infra/release and both the master and stable-2.414 branches of jenkinsci/jenkins. I have no strong preference either way, but it seems like less work in the long term to do the backport and be done with this SUSE stuff sooner rather than later.

A final (but very minor) point is that there was previously a nonsensical "1.2" version for the jenkins-2.373-1.2.noarch.rpm (SUSE) RPM, which seemed to exist only to differentiate it from the "1.1" version used by the jenkins-2.373-1.1.noarch.rpm (Red Hat) RPM. Since we're now combining these into one product, I wonder if it wouldn't be too hard to remove the "-1.1" from the (sole remaining) RPM, which would make it match our Debian product (e.g. jenkins_2.373_all.deb). The "1.1" has no meaning in terms of Jenkins versioning. See #345.

README.md Outdated Show resolved Hide resolved
@philfry
Copy link
Contributor Author

philfry commented Sep 8, 2023

A final (but very minor) point is that there was previously a nonsensical "1.2" version for the jenkins-2.373-1.2.noarch.rpm (SUSE) RPM, which seemed to exist only to differentiate it from the "1.1" version used by the jenkins-2.373-1.1.noarch.rpm (Red Hat) RPM. Since we're now combining these into one product, I wonder if it wouldn't be too hard to remove the "-1.1" from the (sole remaining) RPM, which would make it match our Debian product (e.g. jenkins_2.373_all.deb). The "1.1" has no meaning in terms of Jenkins versioning. See #345.

An RPM is required to have a release number, so we cannot skip it completely. I changed it simply to "1" now.

@philfry
Copy link
Contributor Author

philfry commented Sep 8, 2023

To get rid of the suse.publish target in the Makefile, the suse/publish/publish.sh script, and the SUSE_URL, SUSEDIR, and SUSE_WEBDIR environment variables, we just need to get rid of the SUSE stage from https://github.com/jenkins-infra/release/blob/8951254c4a415d24d81b8b9c351b9bb6a07408f8/Jenkinsfile.d/core/package#L226-L248 […]

Sounds good.
I checked whether or not I could use the redhat repo out of the box with openSUSE 15. Even tough it gives me a warning:

Warning: File 'repomd.xml' from repository 'Jenkins' is unsigned.

the redhat rpm installed without problems.
So probably before removing /opensuse/repodata or redirecting it to /redhat/repodata (guessing), it's probably a good idea to let rpm/publish/publish.sh sign the repomd.md as well.

But isn't the suse publisher still needed for the indexGenerator.py to provide at least the installation instructions for zypper? Sure, we could also include the zypper instructions on the redhat (or "generic rpm") page.

@basil
Copy link
Member

basil commented Sep 8, 2023

Sure, we could also include the zypper instructions on the redhat (or "generic rpm") page.

Yes, that would work just fine. The more we can simplify things, the better, and having one fewer variant to maintain sounds like a great simplification.

- merge openSUSE and Red Hat build scripts as well as their spec files and
  only build a single rpm
- merge openSUSE and Red Hat publish scripts for a common rpm repository
  and a common web page
- always gpg sign repomd.xml and set repo_gpgcheck for the common repo file
- set releasever from 1.1 to 1
- (gitignore test-webroot)
@philfry
Copy link
Contributor Author

philfry commented Sep 28, 2023

Disclaimer: work-in-progress-commit, I expect it to break some tests. Also some things still need a little polish.

The build and publish scripts of openSUSE and Red Hat have been merged into a common rpm target.

Notable changes for openSUSE:

  • zypper config no longer included in the rpm
  • initv scripts no longer included in the rpm
  • logrotate config no longer included in the rpm

Notable changes for Red Hat:

  • repomd.xml is now signed and the repo file has repo_gpgcheck enabled to be openSUSE compilant

As the suse and redhat targets have been united to rpm the webserver and repo paths need to be adapted. I think it would be a good idea to install redirects from /suse and /redhat to /rpm once published.

Tested with:

# remove previous docroot
rm -rf pkg.jenkins.io

# import the rpm signing key and announce it to rpm
gpg --import credentials/test.secret.gpg
echo '%_gpg_name Bogus Test (This is test only key) <[email protected]>' > ~/.rpmmacros

# get the war
export ver="2.414.1"
wget -c https://get.jenkins.io/war-stable/${ver}/jenkins.war

# build the rpm and publish
WAR=${PWD}/jenkins.war MSI=/dev/null \
	make rpm.publish \
	BRAND=./branding/jenkins.mk VERSION=${ver} \
	GPG_KEYNAME="Bogus Test" CREDENTIAL=${PWD}/credentials/test.mk PKGSERVER=${USER}@localhost \
	WEBSERVER=localhost

# run test webserver
WAR=/dev/null MSI=/dev/null make test.local.setup

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.

SUSE: Remove System V initialization script
2 participants