-
-
Notifications
You must be signed in to change notification settings - Fork 388
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
Add systemd unit files to the RPM/DEB packages #3986
Add systemd unit files to the RPM/DEB packages #3986
Conversation
For rpm/deb packages we should probably not use /usr/local but standart locations |
I just extended what was already there with the systemd units. Using So my 2 cents would be that using |
1fa47db
to
be8cc01
Compare
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 don't have much experience bundling binaries + systemd but let's try to make some progress:
- I assume you created the bundles locally and tested them?
- We should extend the docs to explain that users need/can place env vars in
/etc/woodpecker/woodpecker-server.env
(and the agent counterpart).
I tested them manually, i.e. I spun up VMs, installed the RPMs without the systemd service and then created the files locally. The systemd units look similar to what I packaged for openSUSE in the server and agent packages, where I have a vagrant-libvirt setup for testing: https://github.com/johanneskastl/woodpecker_vagrant_libvirt_ansible The major difference is that I create a system user I did not have time to prepare a similar setup using the upstream packages and the files from this PR.
I have no idea how creating RPM/DEB packages with nfpm works, but I think it might be a good idea to create the |
Now, there is a way. |
I know that systemd und RPM support user creation, that is how openSUSE handles this. But the DEB and RPM packages are used on other distributions. And are built using nfpm, where I do not know how easy it is to package the files and add the necessary %pre and %post snippets. But if someone wants to add this functionality to this PR, please feel free. I just wanted to start with a basic example that should (hopefully) work everywhere[tm]. |
👍
But the title of the issue contains only
All of them use RPM.org-version. And here you have introduced systemd dependency, am I right? I also don't know about nfpm, not requesting changes and not willing to add this functionality.
Sure. Just skip my comments :) |
Good catch, fixed that just now, as nfpm is used to build both DEB and RPM packages. |
could we add example env files with default values so people can change them ... |
As far as I understood it there are no default values, as it highly depends on which Forge you are connecting to. Adding a general example file that shows the syntax would be fine, but as this is all in the documentation already it does not make that much sense to duplicate that information... |
I would still prefere it the config files would be created ... not everybody reads systemd service configs but know how to ls /etc/[service]/ Its also fine to leafe it empty or ad only a comment with a link to the docs |
be8cc01
to
b99845d
Compare
I have added two example files (that are named *.example) with instructions. The units will not start, unless the file with the proper name is present. This makes it clearer / easier to find out that you need to create that file with your settings. What do you think? |
please just merge target branch into this and commit new things directly onto feature branches ... a forcepush make it harder to review the diff from last time i reviewed ... |
thanks anyway :) |
Tearing down https://woodpecker-ci-woodpecker-pr-3986.surge.sh |
* add systemd unit file for server (`woodpecker-server.service`) * add systemd unit file for agent (`woodpecker-agent.service`) * add systemd unit files to nfpm package definitions * add etc config file examples fixes woodpecker-ci#1575
Sorry, rebasing is what most other projects want so I am used to it... Thanks for taking care and merging. |
I'm confused, was this removed again shortly after being added? I don't see these files in the |
Nvm I looked at the wrong repo's main and it seems that simply a new release wasn't made since it was merged, forget it then |
woodpecker-server.service
)woodpecker-agent.service
)fixes #1575