我正在尝试使用安装在自定义目录中的 sbt-native-packager 构建一个 rpm 包,例如 /opt/myapp 而不是 /usr - 由于内部策略要求。
我有一个 build.sbt 可以构建一个标准的 rpm,但是在修改目录时我很难过。抱歉,我对 scala、sbt 和本地 pacakger 还是很陌生。
我正在使用 mapGenericFilesToLinux 并希望保留其结构 - 只需修改目标目录的第一部分。
我在 git hub 问题中找到了这个代码片段https://github.com/sbt/sbt-native-packager/issues/4#issuecomment-6731183
linuxPackageMappings <+= target map { target =>
val src = target / "webapp"
val dest = "/opt/app"
LinuxPackageMapping(
for {
path <- (src ***).get
if !path.isDirectory
} yield path -> path.toString.replaceFirst(src.toString, dest)
)
}
我相信我想做类似的事情,除了
linuxPackageMappings in Rpm <++= <SOMETHING HERE> {
// for loop that steps through the source and destination and modifies the directory
}
提前感谢您的帮助
再见帕姆