Allow image application directory to be configurable
An `applicationDirectory` option on the Maven `spring-boot:build-image` goal and the Gradle `bootBuildImage` task can be configured to set the location that will be used to upload application contents to the builder image, and will contain the application contents in the generated image. Closes gh-34786
This commit is contained in:
@@ -193,6 +193,14 @@ class ImageTests {
|
||||
assertThat(request.getCreatedDate()).isEqualTo("2020-07-01T12:34:56Z");
|
||||
}
|
||||
|
||||
@Test
|
||||
void getBuildRequestWhenHasApplicationDirectoryUsesApplicationDirectory() {
|
||||
Image image = new Image();
|
||||
image.applicationDirectory = "/application";
|
||||
BuildRequest request = image.getBuildRequest(createArtifact(), mockApplicationContent());
|
||||
assertThat(request.getApplicationDirectory()).isEqualTo("/application");
|
||||
}
|
||||
|
||||
private Artifact createArtifact() {
|
||||
return new DefaultArtifact("com.example", "my-app", VersionRange.createFromVersion("0.0.1-SNAPSHOT"), "compile",
|
||||
"jar", null, new DefaultArtifactHandler());
|
||||
|
||||
Reference in New Issue
Block a user