-
Notifications
You must be signed in to change notification settings - Fork 23
Prevent native packager bin-compat issues #169
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package controllers | ||
|
||
import javax.inject._ | ||
import play.api._ | ||
import play.api.mvc._ | ||
|
||
@Singleton | ||
class HelloController @Inject() (cc: ControllerComponents) extends AbstractController(cc) { | ||
def index() = Action { _ => | ||
Ok("Hello, World") | ||
} | ||
|
||
def hello(id: String) = Action { _ => | ||
Ok(s"Hello, $id") | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This scripted test is a copy/paste/trim version of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe just update play-endpoints to Play 2.6.21 and keep this one minimal to the plugin conflict? Also, maybe rename this test. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I kept There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah users should be able to always upgrade to latest bugfix version, in this case of Play and sbt-reactive-app. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name := "hello-play" | ||
scalaVersion := "2.11.12" | ||
|
||
libraryDependencies += guice | ||
|
||
lazy val root = (project in file(".")) | ||
.enablePlugins(PlayScala, SbtReactiveAppPlugin) | ||
.settings( | ||
packageName in Docker := "hello-play", | ||
httpIngressPorts := Seq(9000), | ||
httpIngressPaths := Seq("/") | ||
) | ||
|
||
TaskKey[Unit]("check") := { | ||
val outputDir = (stage in Docker).value | ||
val contents = IO.read(outputDir / "Dockerfile") | ||
val lines = Seq( | ||
"""com.lightbend.rp.endpoints.0.protocol="http"""", | ||
"""com.lightbend.rp.endpoints.0.ingress.0.ingress-ports.0="9000"""", | ||
"""com.lightbend.rp.endpoints.0.ingress.0.type="http"""", | ||
"""com.lightbend.rp.endpoints.0.ingress.0.paths.0="/"""", | ||
"""com.lightbend.rp.endpoints.0.name="http"""", | ||
"""com.lightbend.rp.modules.akka-cluster-bootstrapping.enabled="false"""", | ||
"""com.lightbend.rp.modules.play-http-binding.enabled="true"""", | ||
"""com.lightbend.rp.app-type="play"""", | ||
"""com.lightbend.rp.app-name="hello-play"""", | ||
"""com.lightbend.rp.modules.common.enabled="true"""", | ||
"""com.lightbend.rp.modules.secrets.enabled="false"""", | ||
"""com.lightbend.rp.modules.service-discovery.enabled="false"""" | ||
) | ||
|
||
lines.foreach { line => | ||
if (!contents.contains(line)) { | ||
sys.error(s"""Dockerfile is missing line "$line"""") | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
play.crypto.secret = whatever |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
GET / controllers.HelloController.index | ||
GET /hello/:id controllers.HelloController.hello(id: String) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
sys.props.get("plugin.version") match { | ||
case Some(x) => addSbtPlugin("com.lightbend.rp" % "sbt-reactive-app" % x) | ||
case _ => sys.error("""|The system property 'plugin.version' is not defined. | ||
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin) | ||
} | ||
|
||
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.6.21") | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
> docker:stage | ||
> check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the original change. The breaking changes in
docker.DockerKeys
prevents usersbt
's from running. This PR adds a scripted test to assert this fix kicks in.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍