Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sbt-release with docker plugin step #475

Closed
mhamrah opened this issue Jan 27, 2015 · 9 comments
Closed

sbt-release with docker plugin step #475

mhamrah opened this issue Jan 27, 2015 · 9 comments
Labels
docker documentation Documentation should be extended or updated

Comments

@mhamrah
Copy link
Contributor

mhamrah commented Jan 27, 2015

I'm trying to add a ReleaseStep using sbt-release that publishes a docker image. I've overwritten the current release process like so:

ReleaseKeys.releaseProcess := Seq[ReleaseStep](
  releaseTask(publishLocal in Docker)
)

but nothing happens when I run release (I've tried reloading sbt). When running

docker:publishLocal

everything works fine, I thought this translated to a TaskKey of publishLocal in Docker for sbt-release. I figure I'm missing something obvious. I glanced at this code, and it appears that docker.Keys.publishLocal is set to sbt.publishLocal, and I can't figure out how the docker setting for publish local maps to a task.

Thanks,

Mike

FYI sbt-native-packager 0.8.0.

@muuki88 muuki88 added docker documentation Documentation should be extended or updated labels Jan 28, 2015
@muuki88
Copy link
Contributor

muuki88 commented Jan 28, 2015

I'll try to reproduce this with a small example. IMHO it sounds like some interaction problem with sbt-release, however I haven't tried it with sbt-np yet.

@mhamrah
Copy link
Contributor Author

mhamrah commented Jan 28, 2015

@muuki88 I hacked around with it, and stumbled upon a solution but I don't know why it works. I had to add "in ref" to the release step:

lazy val dockerRelease: ReleaseStep = { st: State =>
  val extracted = Project.extract(st)
  val ref = extracted.get(thisProjectRef)
  extracted.runAggregated(publish in Docker in ref, st)
}

I copied code from sbt-release which had something similar.

@mhamrah mhamrah closed this as completed Jan 28, 2015
@muuki88
Copy link
Contributor

muuki88 commented Jan 29, 2015

Thanks for sharing @mhamrah If you have time it would be awesome to provide a small example for this in the docs (with a minimal build.sbt) showing this. There is an advanced topics section in src/sphinx/topics where this would fit perfectly.

@jsuereth you have any clue why @mhamrah 's solution works?

@mhamrah
Copy link
Contributor Author

mhamrah commented Jan 29, 2015

@muuki88 I'm always happy to add documentation!

@muuki88
Copy link
Contributor

muuki88 commented Jan 29, 2015

That's awesome to hear :) Looking forward to your pull request

@ChristoRibeiro
Copy link

ChristoRibeiro commented Mar 14, 2017

Here is a more elegant way with releaseStepTask:

releaseProcess := Seq(
  checkSnapshotDependencies,
  inquireVersions,
  runTest,
  ReleaseStep(releaseStepTask(publish in Docker)))

@muuki88
Copy link
Contributor

muuki88 commented Mar 15, 2017

Thanks for sharing @ChrisSom

@nemo83
Copy link

nemo83 commented Jun 27, 2017

did this end up in any documentation? Am working on something similar

@muuki88
Copy link
Contributor

muuki88 commented Oct 4, 2019

relates to #974

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker documentation Documentation should be extended or updated
Projects
None yet
Development

No branches or pull requests

4 participants