简体   繁体   中英

config directory when using sbt-native-packager

I'd like to ask about reasoning behind the fact, that the sbt-native-packager plugin creates a symlink /etc/ -> /usr/share//conf (instead of really putting files there and somehow specifying in the app where to look for them)?

In particular how does it influence update/uninstall+install process? Are the configs somehow preserved (for example for debian with java_server architecture setting)?

I'd like to ask about reasoning behind the fact, that the sbt-native-packager plugin creates a symlink /etc/ -> /usr/share//conf

Keeping everything in one place. You have your application directory which contains everything and then you just link from the OS-specific folders to the according directories in your application folder.

Are the configs somehow preserved

Yes indeed. You can try it out with a simple play application. Add this to your build.sbt

mappings in Universal <+= (packageBin in Compile, baseDirectory ) map { (_, base) =>
     val conf = base / "conf" / "application.conf"
     conf -> "conf/application.conf"
} 

This will map your application.conf in the conf folder. When you build a debian package with

debian:packageBin

you can see in target/-/DEBIAN/conffiles an entry

/usr/share/<app-name>/conf/application.conf

An apt-get remove your-app won't remove this file, only a purge

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM