-
Notifications
You must be signed in to change notification settings - Fork 445
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
how to question :: integration with gitlab CI #1213
Comments
Hi @stefangweichinger The question is how you want to version (tag) your docker file. This is generally an sbt configuration. You could use the
|
thanks @muuki88 , will try in a few days (after other projects) |
@muuki88 :: I changed my mind and tried it quickly, "sbt docker: publish" fails with
The quoting seems wrong to me, the "`" in your example is single ... even removing that single quote fails. trying to figure it out now. |
@stefangweichinger, it should be this (without the dollar sign and the backtick): version := "1.0-" + sys.env("CI_COMMIT_SHA") Note that There are other problems with this solution - for one, it doesn't work with local builds. These can be worked around, but I highly recommend using sbt-dynver instead. |
@nigredo-tori thanks for the pointer, that sounds very helpful. Starting to play with it and solving the next issues on my way. |
@nigredo-tori , unfortunately it bails out with:
The format looks the same as in the README of the plugin ... maybe you can help? |
@stefangweichinger, AFAICT, this should work. |
@nigredo-tori thanks, I overread that. Forgive my newbie-questions, do I simply have to add it to build.sbt? |
Yes. |
didn't work for me, but the other lines do:
|
Sorry, looks like |
yes, it does so far. I close here, thanks |
one more, I struggle with getting the image-name right. At best I would prefer to be able to make use of the variables the GitLab CI provides, for example
(How) can I use such variables with |
Hi, I set version of my docker image like that Me, when I run
any ideas ? Thanks |
@stefangweichinger, you can do something along the lines of: dockerAlias := sys.env.getOrElse("CI_REGISTRY_IMAGE", sys.error("CI_REGISTRY_IMAGE not set")) See https://www.scala-sbt.org/sbt-native-packager/formats/docker.html for more. @elha-da, you don't have |
@nigredo-tori Thanks 👍 |
@elha-da, it seems I was not entirely correct. Skimming through the sbt Docker/stage which would build a staging directory ( That said, I haven't tried this yet, and I can't be sure this will still be possible in the future SNP versions. |
Thanks, will try after my vacation ... |
@nigredo-tori You're right. With SBT and JDK I had to add Docker to the container. It works fine.
Thanks a lot for your help |
I am trying to write a .gitlab-ci.yml that uses "sbt docker:publish" to generate and push a new image for each new commit to the gitlab repo. And I still haven't figured out how and where to configure that.
I assume I would have to call "sbt docker" with the $CI_COMMIT_TAG variable or so, could someone please point me at some example or howto? Thanks a lot.
The text was updated successfully, but these errors were encountered: