-
Notifications
You must be signed in to change notification settings - Fork 444
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Docker] add dockerEnvVars support (#1137)
* add dockerEnvVars support * add sbt scripted test * fix doc * scalafmt * sbt 0.13.x compat, fix plugins type * add docs * scalafmt
- Loading branch information
Showing
7 changed files
with
43 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
enablePlugins(DockerPlugin) | ||
|
||
name := "simple-test" | ||
|
||
version := "0.1.0" | ||
|
||
dockerEnvVars := Map("FOO" -> "bar", "FOO_BAR" -> "foo bar", "NUMBER" -> "123") | ||
|
||
|
||
TaskKey[Unit]("checkDockerfile") := { | ||
val dockerfile = IO.read((stagingDirectory in Docker).value / "Dockerfile") | ||
|
||
assert(dockerfile contains """ENV FOO="bar"""", s"does not contain foo=bar\n$dockerfile") | ||
assert(dockerfile contains """ENV FOO_BAR="foo bar"""", s"does not contain foo=bar\n$dockerfile") | ||
assert(dockerfile contains """ENV NUMBER="123"""", s"does not contain foo=bar\n$dockerfile") | ||
|
||
streams.value.log.success("Successfully tested Dockerfile") | ||
() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % sys.props("project.version")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Stage the distribution and ensure files show up. | ||
> docker:stage | ||
> checkDockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters