Skip to content

Commit

Permalink
Fix ci publish
Browse files Browse the repository at this point in the history
  • Loading branch information
viktor-podzigun committed Dec 23, 2021
1 parent cef85ec commit 9f4e1e0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
28 changes: 17 additions & 11 deletions project/src/main/scala/definitions/AdminServer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import com.typesafe.sbt.packager.archetypes.JavaAppPackaging
import com.typesafe.sbt.packager.docker.Cmd
import com.typesafe.sbt.packager.docker.DockerPlugin.autoImport._
import com.typesafe.sbt.packager.universal.UniversalDeployPlugin
import common.Libs
import common.CommonPlayModule
import common.{CommonPlayModule, Libs}
import sbt.Keys._
import sbt._
import webscalajs.WebScalaJS.autoImport._
Expand Down Expand Up @@ -33,16 +32,23 @@ object AdminServer extends AdminModule with CommonPlayModule {
//dockerImageCreationTask := (publishLocal in Docker).value,
dockerBaseImage := "openjdk:9-slim",
mappings in (Compile, packageDoc) := Seq(),
publishArtifact in (Compile, packageDoc) := false,

dockerCommands := (dockerCommands.value match {
case Seq(from@Cmd("FROM", _), rest@_*) =>
Seq(
from,
//set JVM TTL, see https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/java-dg-jvm-ttl.html
Cmd("RUN", "mkdir", "-p", "$JAVA_HOME/jre/lib/security"),
Cmd("RUN", "echo", "networkaddress.cache.ttl=60", ">>", "$JAVA_HOME/jre/lib/security/java.security")
) ++ rest
})
dockerCommands := {
val commands = dockerCommands.value
val lines = commands.map(_.makeContent)
val splitIndex = lines.indexWhere(_.startsWith("COPY --from=stage0"))
if (splitIndex < 0) {
throw new IllegalStateException(s"Expected COPY --from=stage0 command in Dockerfile:\n${lines.mkString}")
}

val (part1, part2) = commands.splitAt(splitIndex)
part1 ++ Seq(
//set JVM TTL, see https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/java-dg-jvm-ttl.html
Cmd("RUN", "mkdir", "-p", "$JAVA_HOME/jre/lib/security"),
Cmd("RUN", "echo", "networkaddress.cache.ttl=60", ">>", "$JAVA_HOME/jre/lib/security/java.security")
) ++ part2
}
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ class PlayLiquibase @Inject()(environment: Environment, config: Configuration, i
protected def liquibase(): Option[Liquibase] = {
var missingRequiredParam = false

/** get p parameter from cfg.
/*
* get p parameter from cfg.
* If not found use defValue
*
* @param p parameter get value for
Expand Down

0 comments on commit 9f4e1e0

Please sign in to comment.