Expose the generated rpm filepath
See original GitHub issueThe 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:
# This generates the rpm but does not log anything to the console
PACKAGE_OUTPUT=$(sbt "print rpm:packageBin")
echo $PACKAGE_OUTPUT
# Extract the rpm filename full path
RPM_FILE=$(echo $PACKAGE_OUTPUT | tail -n1)
curl --user "$NEXUS_USERNAME:$NEXUS_PASSWORD" --upload-file $RPM_FILE https://nexus.example.com/repository/yum-releases/7/os/$ARCH/$(basename $RPM_FILE)
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:
sbt "rpm:packageBin"
RPM_FILE=$(sbt "rpm:filename" | tail -n1)
curl --user "$NEXUS_USERNAME:$NEXUS_PASSWORD" --upload-file $RPM_FILE https://nexus.example.com/repository/yum-releases/7/os/$ARCH/$(basename $RPM_FILE)
Information
- What sbt-native-packager are you using: 1.4.1
- What sbt version: 1.3.2
- What is your build system: Arch Linux + rpm-org package
- What package are you building: rpm
- What version has your build tool: 4.15.0
- What is your target system: CentOS 7
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Creating an rpm from files and folders from the current directory
I can build the rpm locally without any of the Sources specified but src.rpm fails with an empty set of files to package....
Read more >Chapter 3. Packaging software Red Hat Enterprise Linux 7
This section describes how to build an RPM after a SPEC file for a program has been created. RPMs are built with the...
Read more >How to create a RPM Package
To build an rpm file based on the spec file that we just created, we need to use rpmbuild command. rpmbuild command is...
Read more >Packagers RPM tutorial - Mageia wiki
To build packages, rpm needs a special tree in your home directory. This tree can be created with the following command:
Read more >RPM: Example Basics of RPM Building - Super User
I have a basic RPM question. I don't know very much about RPM building, besides the basic .rpmmacros file, the build directory etc....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@muuki88 yes!
@muuki88,
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.
DockerPlugin
yet), so without a setting like this I would have to either postprocess the build output to move the file to a known path (easy, but annoying), or pass this uncertainty to the resulting docker image.That, indeed, would be a hack. Which is why we should use
artifactPath
instead:This also doesn’t require any new settings, but it’s as idiomatic as it gets - you’ll find that
Compile / packageBin
usesCompile / packageBin / artifactPath
for the same purpose, albeit with a bit of indirection.