-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
New source: pleaserun #1119
Merged
Merged
New source: pleaserun #1119
Conversation
This file contains 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
Long term, we'll probably have a "smart" post-install that will choose the correct service (systemd, etc) to install based on the platform doing the installation, not the platform creating the package :) Adds dependencies on pleaserun and upgrades clamp to suit. Example using the defaults in pleaserun: # Create a package called 'example-service' that installs a service named 'example' % bin/fpm -s pleaserun -t rpm -n example-service --pleaserun-name example =logger hello world No platform selected. Autodetecting... {:platform=>"systemd", :version=>"default", :level=>:warn} Writing file {:destination=>"/tmp/package-pleaserun-staging20160513-12576-1ozurnf/lib/systemd/system/example.service"} Writing install actions. You will want to run this script to properly activate your service on the target host {:path=>"/tmp/package-pleaserun-staging20160513-12576-1ozurnf/install_actions.sh"} Created package {:path=>"example-service-1.0-1.x86_64.rpm"} # ^^ The above service will execute "logger hello world" # What's in our rpm? % rpm -qlp example-service-1.0-1.x86_64.rpm /lib/systemd/system/example.service # What about any post-install steps? % rpm -qp example-service-1.0-1.x86_64.rpm --scripts postinstall scriptlet (using /bin/sh): systemctl --system daemon-reload # Install it. % sudo rpm -ivh example-service-1.0-1.x86_64.rpm # Start it. % sudo systemctl start example # Check the logs! % sudo tail -n1 /var/log/messages May 13 03:32:55 localhost root: hello world Example choosing 'sysv' as the platform: % bin/fpm -s pleaserun -t rpm -n example-service --pleaserun-platform sysv --pleaserun-name example =logger hello world Writing file {:destination=>"/tmp/package-pleaserun-staging20160513-13675-xae6xd/etc/init.d/example"} Writing file {:destination=>"/tmp/package-pleaserun-staging20160513-13675-xae6xd/etc/default/example"} Created package {:path=>"example-service-1.0-1.x86_64.rpm"} % rpm -qlp example-service-1.0-1.x86_64.rpm /etc/default/example /etc/init.d/example
… detected. Also move files to be /platform/version/... instead of /platform-version/...
* Only try install actions if they exist * Add special case for Upstart 0.6.5 (CentOS 6)
The scripts will be written to the top-level `.scripts/` directory
The `install.sh` will generate a cleanup.sh script that is executed when the package is removed.
…. Without this, the default is 'no description given' which is not a helpful default
Closed
👍 |
Specs reasonably passing for me. This PR adds no meaningful tests, but that's partly because I'm still trying to figure out a nice way to actually test it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The
pleaserun
tool helps generate service manifests for different service platforms such as systemd and runit.This PR introduces
pleaserun
as a package source. The goal is to have a package you can install that will "do the right thing" and install the best-fitting service manifest for the target system.Example usage:
Yay, easy services!
It also tries to clean up during package removal: