mirror of
https://github.com/Eyre-S/Coeur-Morny-Cono.git
synced 2024-11-24 12:07:39 +08:00
Compare commits
2 Commits
4faa9cb5e5
...
7e668bd974
Author | SHA1 | Date | |
---|---|---|---|
7e668bd974 | |||
7cf06a539c |
@ -8,7 +8,7 @@ ARG DOCKER_BUILD=yes
|
||||
RUN cd ./source \
|
||||
&& sbt assembly \
|
||||
&& cd .. \
|
||||
&& cp ./source/target/morny-coeur-docker-build.jar ./morny-coeur.jar
|
||||
&& cp ./source/morny-coeur/target/morny-coeur-docker-build.jar ./morny-coeur.jar
|
||||
#&& rm -r ./source \
|
||||
#&& rm -r /root/.gradle \
|
||||
|
||||
|
37
build.sbt
37
build.sbt
@ -13,7 +13,10 @@ ThisBuild / resolvers ++= Seq(
|
||||
|
||||
ThisBuild / crossPaths := false
|
||||
|
||||
ThisBuild / Compile / packageDoc / publishArtifact := false
|
||||
if (!MornyProject.publishWithDocJar) {
|
||||
(ThisBuild / packageDoc / publishArtifact := false) :: Nil
|
||||
} else Nil
|
||||
|
||||
artifactName := {(sv: ScalaVersion, module: ModuleID, artifact: Artifact) =>
|
||||
val classifier = artifact.classifier match {
|
||||
case Some(value) => s"-$value"
|
||||
@ -50,8 +53,8 @@ ThisBuild / apiMappings ++= {
|
||||
ThisBuild / publishTo := MornyProject.publishTo
|
||||
ThisBuild / credentials ++= MornyProject.publishCredentials
|
||||
|
||||
|
||||
lazy val morny_system_lib = (project in file (MornyProject.morny_system_lib.id))
|
||||
.enablePlugins(BuildInfoPlugin)
|
||||
.settings(
|
||||
|
||||
name := MornyProject.morny_system_lib.name,
|
||||
@ -111,14 +114,44 @@ lazy val morny_coeur = (project in file(MornyProject.morny_coeur.id))
|
||||
|
||||
)
|
||||
|
||||
lazy val dockerImageName: SettingKey[String] = settingKey[String]("Docker image name that want to built")
|
||||
lazy val dockerImageTag: SettingKey[String] = settingKey[String]("Docker image tag or aka image version of the built image")
|
||||
lazy val dockerBuild: TaskKey[Unit] = taskKey("Build using system docker with current version as the container tag")
|
||||
|
||||
lazy val root = (project in file ("."))
|
||||
.aggregate(morny_system_lib, morny_coeur)
|
||||
.settings(
|
||||
|
||||
name := "Coeur Morny Cono",
|
||||
|
||||
skip := true,
|
||||
update / skip := false,
|
||||
|
||||
assembly / aggregate := false,
|
||||
assembly := {
|
||||
(morny_coeur / assembly).value
|
||||
},
|
||||
run / aggregate := false,
|
||||
run := {
|
||||
(morny_coeur / Compile / run).evaluated
|
||||
},
|
||||
|
||||
dockerImageName := MornyProject.docker_image_name,
|
||||
dockerImageTag := version.value,
|
||||
dockerBuild := {
|
||||
|
||||
val builtImageName = dockerImageName.value
|
||||
val builtImageTag = (ThisProject / dockerImageTag).value
|
||||
sLog.value info s"Building docker image with name $builtImageName:$builtImageTag"
|
||||
|
||||
import scala.language.postfixOps
|
||||
import scala.sys.process.*
|
||||
s"docker build -t $builtImageName:$builtImageTag ."!
|
||||
|
||||
sLog.value info s"Built docker image $builtImageName:$builtImageTag"
|
||||
|
||||
}
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@ object MornyConfiguration {
|
||||
val MORNY_CODE_STORE = "https://github.com/Eyre-S/Coeur-Morny-Cono"
|
||||
val MORNY_COMMIT_PATH = "https://github.com/Eyre-S/Coeur-Morny-Cono/commit/%s"
|
||||
|
||||
val VERSION = "2.0.0-alpha20"
|
||||
val VERSION = "2.0.0-alpha21"
|
||||
val VERSION_DELTA: Option[String] = None
|
||||
val CODENAME = "xinzheng"
|
||||
|
||||
@ -15,6 +15,8 @@ object MornyConfiguration {
|
||||
val GROUP = "cc.sukazyo"
|
||||
val GROUP_NAME = "A.C. Sukazyo Eyre"
|
||||
|
||||
val DOCKER_IMAGE_NAME = "coeur-morny-cono"
|
||||
|
||||
trait ProjectMetadata {
|
||||
|
||||
val name: String
|
||||
@ -65,7 +67,7 @@ object MornyConfiguration {
|
||||
|
||||
object Morny_Coeur extends ProjectMetadata with Runnable {
|
||||
|
||||
override val name = "Coeur Morny Cono"
|
||||
override val name = "Morny Coeur"
|
||||
override val id = "morny-coeur"
|
||||
|
||||
override val group = GROUP
|
||||
|
@ -44,7 +44,10 @@ object MornyProject {
|
||||
val group = MornyConfiguration.GROUP
|
||||
val group_name = MornyConfiguration.GROUP_NAME
|
||||
|
||||
val docker_image_name = MornyConfiguration.DOCKER_IMAGE_NAME
|
||||
|
||||
val publishWithFatJar = !version_is_snapshot
|
||||
val publishWithDocJar = !version_is_snapshot
|
||||
def publishTo = MornyConfiguration.publishTo
|
||||
val publishCredentials = MornyConfiguration.publishCredentials
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user