-
Notifications
You must be signed in to change notification settings - Fork 441
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
Expose the generated rpm filepath #1287
Comments
Thanks for your feature request 😃 To understand the issue better let me recap
If this is correct then I have a few questions
I'm always very cautions with adding new settings that don't add any value, but act as a workaround to remove some other workaround 😁 Adding settings is easy, removing isn't 😉 |
Just my two cents here. (all of this is a personal opinion of a person who doesn't use the RPM plugin). |
With the proper cli params no post processing should be required $ sbt --error --supershell=false "print version" returns only the version and nothing else 😎
I would argue that the RPM path is well known as well. Not the exact file, but the output directory which only contains one file. It's also totally legit to build some helpers around that suit your needs. From my experience build pipelines can differ quite a lot, so baking a single use case into native-packager seems weird. What we could do without introducing a new setting is the following hack Rpm / packageBin / targetDirectory := // define the rpm path
Rpm / packageBin := {
val rpmFile := (Rpm / packageBin / targetDirectory).value
} I consider this a hack as |
This also means that we lose most of the log in case anything goes wrong. Also, I don't think this would work if some task logs something at the error level.
That, indeed, would be a hack. Which is why we should use Rpm / packageBin / artifactPath := ???
Rpm / packageBin := {
val rpmFile := (Rpm / packageBin / artifactPath).value
} This also doesn't require any new settings, but it's as idiomatic as it gets - you'll find that |
I did it with two separate steps: the packageBin and the curl.
If packageBin uses the setting
Because it forces me to consider more failure cases. Given that native-packager already knows the full path to the rpm it is also unnecessary. Currently the code first invokes
That would be bad code. If the plugin changes the code would break as that assumption would no longer be valid. If instead I use a path which the plugin says it used to generate the file then that would always be the right path. |
Awesome @nigredo-tori ! I haven't yet come across @Lasering would you be interested in making a pull request that introduces Rpm / packageBin / artifactPath := ???
Rpm / packageBin := {
val rpmFile := (Rpm / packageBin / artifactPath).value
} as described in @nigredo-tori comment? |
@muuki88 yes! |
Looking forward ❤️ |
* Introduce RPM / packageBin / artifactPath setting. Closes #1287 * Fix setting cannot depend on a task. * Proper fix. * Now without breaking mima. * Add a little bit of documentation. And a sbt-test. * Fix test Co-authored-by: Nepomuk Seiler <muuki88@users.noreply.github.com>
The generated rpm filename should be exposed via a setting.
I generate an rpm via
sbt rpm:packageBin
in a CI which I then upload to a nexus using curl:But its quite clunky as the
sbt "print rpm:packageBin"
is what actually generates the rpm. It is also the only way to know the generated rpm filename (apart from computing it from the other settings). The code that would be easy to read should be something like:Information
The text was updated successfully, but these errors were encountered: