-
Notifications
You must be signed in to change notification settings - Fork 443
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
Directories in packageMapping #6
Comments
What do you think of the following API? linuxPackageMapping <+= target map { t =>
mapDirectoryAndContents(target / "webapp", "/opt/app")
} You can then use the combinators to do more, like: linuxPackageMapping <+= target map { t =>
(mapDirectoryAndContents(target / "webapp/config", "/opt/app/config")
gzipped()
withConfig("autoreplace")
)
} That's until I come up with a better idea to do package mappings of files in a convenient way. Personally I liked how the maven-rpm-plugin worked, but I need to think through how to make something handy in SBT like that. |
It makes more sense to have this as a flag: linuxPackageMapping <+= target map { t =>
packageMapping(target / "webapp", "/opt/app") withContents()
} However, On a side note, I also don't see a reason for having one-to-many relationship between metadata and mapping, especially after this feature is implemented (as the amount of mappings will greatly reduce for most projects). |
The rpm-maven-plugin is doing some crazy stuff with those mappings. Crazy and uncontrollable and can be a PITA to debug. I remember. This is explicit, and I use the mutli-mapping feature all the time. In any case, I find myself missing two features from the maven-rpm-plugin: (1) Auto-resolving dependencies into desired locations and assinging permissions. Something like: linuxPackageMapping <++= libraryDependencies { ld =>
def runtimeScoped(a: ModuleID): Boolean = ...
(dependencyMappings(ld filter runtimeScoped)
into "/usr/share/java"
withPermissions("755")
)
} And then something else that can take a directory and its sub directories and map them appropriately. The issue we have is that the Maven rpm plugin actually parses a config file to determine filtering. If you configure a sub-directory or file differently than a parent, something different happens. I can add logic like this of course, but I'd prefer a more SBT solution, one that uses common SBT-isms like filters and exlcudes, etc. |
Josh, Our process Once we have staged (*.jars), and start script, run deb package. It will be cumbersome to include all the required jars recursively. This fix worked perfectly. Thankyou linuxPackageMappings <+= target map { target =>
val src = target / "staged"
val dest = "/usr/local/mp/lib"
LinuxPackageMapping(
for {
path <- (src ***).get
if !path.isDirectory
} yield path -> path.toString.replaceFirst(src.toString, dest)
)
} |
Hey guys, glad to hear it. I'm hoping to revamp this stuff shortly, possibly with some more nice/clean defaults for most projects. Just haven't had time recently. Patches are welcome thoguh. |
@Dremora You should look at the auto-debian support in the latest version as well. You can now create a debian file for 'generic' java applications. Play 2.2 is pulling this in by default. |
Currently it's not possible just to specify a single dir in
packageMapping
, one has to recursively go through its contents. The following code does not work as expected:A way of dealing with it on the client side:
It would be nice to have this functionality on the library side for consistent and expected behavior.
The text was updated successfully, but these errors were encountered: