I'm a newbie for scala.
I used sbt-release to control release process and sbt-docker to build/publish a docker image.
I can release a specific version via sbt release
and build/publish a docker image via sbt docker
or `sbt dockerBuildAndPush'
If I wanna release a specific version, I need to
- execute
sbt release
- remember the release version and modify docker image tag with the release version
- execute
sbt dockerBuildAndPush
But it's so tedious...
I wanna add build/publish docker image into release process.
For example:
I define my release process in build.sbt
val publishDocker = ReleaseStep(action = st => {
// 1. get release version from sbt-release
// 2. add release version to docker image tag
// 3. push docker image to aws ecr
})
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
publishDocker,
setNextVersion,
commitNextVersion,
pushChanges
)
But I have no idea how to implement publishDocker function.
Thanks for your help~
I'm not familiar with
sbt-docker
but you can get theversion
from thest: State
parameter:@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.