I would like to receive data of type version
, packageName in Docker
and anyway. I need my CI to label the docker image for future use. Thus, is it possible to get values ββlike with maven mvn --batch-mode -f pom.xml help:evaluate -Dexpression=project.version
. Thank you for your help.
So, my build.sbt contains several projects, and now I'm trying to use sbt projects
, sbt inspect
from sbt, to check the assembly , but so far no luck.
I managed to get the key values ββfrom the project, but now I have a problem with packageName in Docker
. I do this with help sbt [project_name]/[key]
, but for packageName in Docker
I got:
sbt projectName/packageName in Docker
[error] Not a valid command: in
[error] Expected 'info'
[error] Not a valid project ID: in
[error] Expected ':' (if selecting a configuration)
[error] Not a valid key: in
[error] in
[error] ^
This is part of build.sbt:
lazy val `name` = project
.in(file("name"))
.dependsOn(`name-dep`)
.settings(defaults)
.settings(
packageName in Docker := "project/name",
version := "3.1.0-SNAPSHOT",
dockerExposedPorts := Seq(8080),
dockerCommands ++= Seq(
Cmd("ENTRYPOINT",
s"bin/${executableScriptName.value}",
"-l", "tcp://0.0.0.0:8081",
"-e", "${EXTERNAL_URL}",
"-c", "${CONNECTOR_URL}")
),
For the version I use:
sbt name/version
[info] Loading project definition from /home/jenkins/.jenkins/workspace/project
[info] Set current project to root (in build file:/home/jenkins/.jenkins/workspace/)
[info] 3.1.0-SNAPSHOT
but i have problems with packageName in Docker
My decision:
so I managed to get these values ββwith:
# sbt -Dsbt.log.noformat=true name/packageName | sed -n 3p | cut -d " " -f 2
name
( project/
), , , CI script.
# sbt -Dsbt.log.noformat=true name/version | sed -n 3p | cut -d " " -f 2
3.1.0-SNAPSHOT
- , , .
, sbt ASCII , , sbt -Dsbt.log.noformat=true
, CI ENV, .