user1078671
user1078671

Reputation:

Custom deployment with sbt

I have a Scala application and i want to setup a deployment process result similar to one Akka sbt plugin gives, but i it requires project to be a microkernel. Sbt-assembly is a very cool plugin, but i want to have a free access to my config files, basically i want to have the following app structure:

/app/bin    - start script bash file
    /config - all my application .conf files
    /deploy - my project .jar with classes
    /lib    - all my dependencies .jar files
    /logs   - log files

I we checked typesafe sbt-native-packager, it's better, but it could place my .conf file and logs out of jars. All those settings in SBT looks confusing to me, what can i do to with this?

Upvotes: 3

Views: 684

Answers (1)

4lex1v
4lex1v

Reputation: 21567

Actually this is not hard to update akka-sbt-plugin to make it work in general, add this file to your project folder and somewhere in your build the following settings:

  .settings(Distribution.distSettings: _*)
  .settings(mappings in Compile in packageBin ~= { _.filter(!_._1.getName.endsWith(".conf")) })

The first line adds all dist settings to your project and the second one excludes all .conf files from your .jar and reads them from config folder.

Now you have to commands: dist - creates a folder with a structure you've discribed and zipDist which packs it all into .zip file, later you can add this to you publish setting:

addArtifact(Artifact(someName, "zip", "zip"), zipDist)

Upvotes: 2

Related Questions