How to push/build a docker image in release process via sbt-release

你离开我真会死。 提交于 2019-12-04 20:05:53
pandaforme

@ed Thanks for your advice and I solved it by myself :>

This is my sbt: https://gist.github.com/pandaforme/e378dc3f1f32aa252b14e40937491e9c

I just execute sbt release and it'll automatically compile, generate release version, build and push docker image, etc.

I'm not familiar with sbt-docker but you can get the version from the st: State parameter:

val publishDocker = ReleaseStep(action = st => {
  // 1. get version from sbt
  // (it was set by sbt-release in setReleaseVersion)
  val extracted = Project.extract(st)
  val version:String = extracted.get(sbt.Keys.version)

})
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!