-
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.
- Loading branch information
Showing
5 changed files
with
25 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import NativePackagerKeys._ | ||
|
||
enablePlugins(JavaAppPackaging) | ||
|
||
name := "docker-test" | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Stage the distribution and ensure files show up. | ||
> show docker:stage | ||
> docker:stage | ||
$ exists target/docker/Dockerfile | ||
$ exists target/docker/files |
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 |
---|---|---|
|
@@ -2,15 +2,15 @@ enablePlugins(JavaAppPackaging) | |
|
||
name := "docker-test" | ||
|
||
packageName := "docker-package" // sets the executable script, too | ||
packageName := "docker-package" | ||
|
||
version := "0.1.0" | ||
|
||
maintainer := "Gary Coady <[email protected]>" | ||
|
||
TaskKey[Unit]("check-dockerfile") <<= (target, streams) map { (target, out) => | ||
val dockerfile = IO.read(target / "docker" / "Dockerfile") | ||
assert(dockerfile.contains("ENTRYPOINT [\"bin/docker-package\"]\n"), "dockerfile doesn't contain ENTRYPOINT [\"docker-package\"]\n" + dockerfile) | ||
assert(dockerfile.contains("ENTRYPOINT [\"bin/docker-test\"]\n"), "dockerfile doesn't contain ENTRYPOINT [\"docker-test\"]\n" + dockerfile) | ||
out.log.success("Successfully tested control script") | ||
() | ||
} |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Generate the Docker image locally | ||
> docker:publishLocal | ||
$ exists target/docker/Dockerfile | ||
$ exists target/docker/files/opt/docker/bin/docker-package | ||
$ exists target/docker/files/opt/docker/bin/docker-test | ||
> check-dockerfile | ||
$ exec bash -c 'docker run docker-package:0.1.0 | grep -q "Hello world"' |