-
Notifications
You must be signed in to change notification settings - Fork 83
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
Convert RPMs from sysvinit to systemd + other cleanups #224
Conversation
I extracted the cleanup stuff into separate PRs and merged it. |
Thanks. I've rebased it and left out all comments that were already merged. No real change otherwise, but it keeps the PR smaller. |
And now that we have a build, you can see that it's failing. Just wait until we have tests! |
Since EL7 systemd is the default init system. This moves away from the legacy sysvinit script to a native unit file. It no longer ships the sysconfig file by default, but it is still read for compatibility. Users are encouraged to use systemd drop in files which are a more native solution. The deprecated PreReq is replaced with a stricter Requires(pre). Ideally sysusers would be used, but the packaging macros in EL7 are different from more modern versions. For now this can be considered a TODO.
Mock guarantees a fresh build environment that respects BuildRequires. It uses EL7 since that's the lowest compatibility level. It does mean it may use suboptimal macros for the platform.
I've been trying to figure out why it failed, but it looks like it uses rpmbuild now which doesn't respect |
@@ -13,7 +13,8 @@ cp "$WAR" $D/SOURCES/jenkins.war | |||
|
|||
pushd $D | |||
mkdir -p BUILD RPMS SRPMS | |||
rpmbuild -ba --define="_topdir $PWD" --define="_tmppath $PWD/tmp" --define="ver $VERSION" SPECS/jenkins.spec | |||
rpmbuild -bs --define="_topdir $PWD" --define="_tmppath $PWD/tmp" --define="ver $VERSION" SPECS/jenkins.spec | |||
mock --define="ver $VERSION" --resultdir=RPMS --root=epel-7-x86_64 SRPMS/*.rpm |
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.
you'll either need to install mock
in the build or add it to the docker image:
https://github.com/jenkins-infra/docker-packaging/blob/main/Dockerfile
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.
It may be hard: I don't think mock is packaged on Ubuntu 18.04 nor if it works in a container, but you also won't have the right RPM macros present with rpmbuild. I'll need to think about this.
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.
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.
I have no clue if that mock is new enough. For now I've tried a hack. If it works, I can send a PR to docker-packaging.
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.
Ok, clearly that hack doesn't work. There's no sudo and the non-root user isn't allowed to install packages.
As of today automated testing has been added for:
Just wait until the tests do more than starting Jenkins! |
This PR was an excellent start. #266 takes it to the finish line. Please help me test it. |
I started to convert the sysvinit script to systemd but got distraced with some other code I had to modify to get it to work. It's not entirely done yet, but I wanted to share some preparation work.