|
|
@ -21,7 +21,6 @@ import java.io.FileWriter;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.PrintWriter;
|
|
|
|
import java.io.PrintWriter;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
|
|
|
import java.util.Collections;
|
|
|
|
import java.util.Collections;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.function.Consumer;
|
|
|
|
import java.util.function.Consumer;
|
|
|
@ -92,10 +91,9 @@ class PaketoBuilderTests {
|
|
|
|
metadata.buildpacks().contains("paketo-buildpacks/ca-certificates",
|
|
|
|
metadata.buildpacks().contains("paketo-buildpacks/ca-certificates",
|
|
|
|
"paketo-buildpacks/bellsoft-liberica", "paketo-buildpacks/executable-jar",
|
|
|
|
"paketo-buildpacks/bellsoft-liberica", "paketo-buildpacks/executable-jar",
|
|
|
|
"paketo-buildpacks/dist-zip", "paketo-buildpacks/spring-boot");
|
|
|
|
"paketo-buildpacks/dist-zip", "paketo-buildpacks/spring-boot");
|
|
|
|
metadata.processOfType("web").extracting("command", "args").containsExactly("java",
|
|
|
|
metadata.processOfType("web").containsExactly("java", "org.springframework.boot.loader.JarLauncher");
|
|
|
|
Collections.singletonList("org.springframework.boot.loader.JarLauncher"));
|
|
|
|
metadata.processOfType("executable-jar").containsExactly("java",
|
|
|
|
metadata.processOfType("executable-jar").extracting("command", "args").containsExactly("java",
|
|
|
|
"org.springframework.boot.loader.JarLauncher");
|
|
|
|
Collections.singletonList("org.springframework.boot.loader.JarLauncher"));
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
assertImageHasJvmSbomLayer(imageReference, config);
|
|
|
|
assertImageHasJvmSbomLayer(imageReference, config);
|
|
|
|
assertImageHasDependenciesSbomLayer(imageReference, config, "executable-jar");
|
|
|
|
assertImageHasDependenciesSbomLayer(imageReference, config, "executable-jar");
|
|
|
@ -163,10 +161,9 @@ class PaketoBuilderTests {
|
|
|
|
metadata.buildpacks().contains("paketo-buildpacks/ca-certificates",
|
|
|
|
metadata.buildpacks().contains("paketo-buildpacks/ca-certificates",
|
|
|
|
"paketo-buildpacks/bellsoft-liberica", "paketo-buildpacks/dist-zip",
|
|
|
|
"paketo-buildpacks/bellsoft-liberica", "paketo-buildpacks/dist-zip",
|
|
|
|
"paketo-buildpacks/spring-boot");
|
|
|
|
"paketo-buildpacks/spring-boot");
|
|
|
|
metadata.processOfType("web").extracting("command", "args").containsExactly(
|
|
|
|
String launcher = "/workspace/" + projectName + "-boot/bin/" + projectName;
|
|
|
|
"/workspace/" + projectName + "-boot/bin/" + projectName, Collections.emptyList());
|
|
|
|
metadata.processOfType("web").containsExactly(launcher);
|
|
|
|
metadata.processOfType("dist-zip").extracting("command", "args").containsExactly(
|
|
|
|
metadata.processOfType("dist-zip").containsExactly(launcher);
|
|
|
|
"/workspace/" + projectName + "-boot/bin/" + projectName, Collections.emptyList());
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
assertImageHasJvmSbomLayer(imageReference, config);
|
|
|
|
assertImageHasJvmSbomLayer(imageReference, config);
|
|
|
|
assertImageHasDependenciesSbomLayer(imageReference, config, "dist-zip");
|
|
|
|
assertImageHasDependenciesSbomLayer(imageReference, config, "dist-zip");
|
|
|
@ -198,10 +195,9 @@ class PaketoBuilderTests {
|
|
|
|
metadata.buildpacks().contains("paketo-buildpacks/ca-certificates",
|
|
|
|
metadata.buildpacks().contains("paketo-buildpacks/ca-certificates",
|
|
|
|
"paketo-buildpacks/bellsoft-liberica", "paketo-buildpacks/dist-zip",
|
|
|
|
"paketo-buildpacks/bellsoft-liberica", "paketo-buildpacks/dist-zip",
|
|
|
|
"paketo-buildpacks/spring-boot");
|
|
|
|
"paketo-buildpacks/spring-boot");
|
|
|
|
metadata.processOfType("web").extracting("command", "args")
|
|
|
|
String launcher = "/workspace/" + projectName + "/bin/" + projectName;
|
|
|
|
.containsExactly("/workspace/" + projectName + "/bin/" + projectName, Collections.emptyList());
|
|
|
|
metadata.processOfType("web").containsExactly(launcher);
|
|
|
|
metadata.processOfType("dist-zip").extracting("command", "args")
|
|
|
|
metadata.processOfType("dist-zip").containsExactly(launcher);
|
|
|
|
.containsExactly("/workspace/" + projectName + "/bin/" + projectName, Collections.emptyList());
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
assertImageHasJvmSbomLayer(imageReference, config);
|
|
|
|
assertImageHasJvmSbomLayer(imageReference, config);
|
|
|
|
assertImageHasDependenciesSbomLayer(imageReference, config, "dist-zip");
|
|
|
|
assertImageHasDependenciesSbomLayer(imageReference, config, "dist-zip");
|
|
|
@ -236,10 +232,9 @@ class PaketoBuilderTests {
|
|
|
|
metadata.buildpacks().contains("paketo-buildpacks/ca-certificates",
|
|
|
|
metadata.buildpacks().contains("paketo-buildpacks/ca-certificates",
|
|
|
|
"paketo-buildpacks/bellsoft-liberica", "paketo-buildpacks/executable-jar",
|
|
|
|
"paketo-buildpacks/bellsoft-liberica", "paketo-buildpacks/executable-jar",
|
|
|
|
"paketo-buildpacks/dist-zip", "paketo-buildpacks/spring-boot");
|
|
|
|
"paketo-buildpacks/dist-zip", "paketo-buildpacks/spring-boot");
|
|
|
|
metadata.processOfType("web").extracting("command", "args").containsExactly("java",
|
|
|
|
metadata.processOfType("web").containsExactly("java", "org.springframework.boot.loader.WarLauncher");
|
|
|
|
Collections.singletonList("org.springframework.boot.loader.WarLauncher"));
|
|
|
|
metadata.processOfType("executable-jar").containsExactly("java",
|
|
|
|
metadata.processOfType("executable-jar").extracting("command", "args").containsExactly("java",
|
|
|
|
"org.springframework.boot.loader.WarLauncher");
|
|
|
|
Collections.singletonList("org.springframework.boot.loader.WarLauncher"));
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
assertImageHasJvmSbomLayer(imageReference, config);
|
|
|
|
assertImageHasJvmSbomLayer(imageReference, config);
|
|
|
|
assertImageHasDependenciesSbomLayer(imageReference, config, "executable-jar");
|
|
|
|
assertImageHasDependenciesSbomLayer(imageReference, config, "executable-jar");
|
|
|
@ -266,10 +261,8 @@ class PaketoBuilderTests {
|
|
|
|
metadata.buildpacks().contains("paketo-buildpacks/ca-certificates",
|
|
|
|
metadata.buildpacks().contains("paketo-buildpacks/ca-certificates",
|
|
|
|
"paketo-buildpacks/bellsoft-liberica", "paketo-buildpacks/apache-tomcat",
|
|
|
|
"paketo-buildpacks/bellsoft-liberica", "paketo-buildpacks/apache-tomcat",
|
|
|
|
"paketo-buildpacks/dist-zip", "paketo-buildpacks/spring-boot");
|
|
|
|
"paketo-buildpacks/dist-zip", "paketo-buildpacks/spring-boot");
|
|
|
|
metadata.processOfType("web").extracting("command", "args").containsExactly("bash",
|
|
|
|
metadata.processOfType("web").containsExactly("bash", "catalina.sh", "run");
|
|
|
|
Arrays.asList("catalina.sh", "run"));
|
|
|
|
metadata.processOfType("tomcat").containsExactly("bash", "catalina.sh", "run");
|
|
|
|
metadata.processOfType("tomcat").extracting("command", "args").containsExactly("bash",
|
|
|
|
|
|
|
|
Arrays.asList("catalina.sh", "run"));
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
assertImageHasJvmSbomLayer(imageReference, config);
|
|
|
|
assertImageHasJvmSbomLayer(imageReference, config);
|
|
|
|
assertImageHasDependenciesSbomLayer(imageReference, config, "apache-tomcat");
|
|
|
|
assertImageHasDependenciesSbomLayer(imageReference, config, "apache-tomcat");
|
|
|
@ -306,9 +299,10 @@ class PaketoBuilderTests {
|
|
|
|
metadata.buildpacks().contains("paketo-buildpacks/ca-certificates",
|
|
|
|
metadata.buildpacks().contains("paketo-buildpacks/ca-certificates",
|
|
|
|
"paketo-buildpacks/bellsoft-liberica", "paketo-buildpacks/executable-jar",
|
|
|
|
"paketo-buildpacks/bellsoft-liberica", "paketo-buildpacks/executable-jar",
|
|
|
|
"paketo-buildpacks/spring-boot", "paketo-buildpacks/native-image");
|
|
|
|
"paketo-buildpacks/spring-boot", "paketo-buildpacks/native-image");
|
|
|
|
metadata.processOfType("web").extracting("command").isEqualTo("/workspace/example.ExampleApplication");
|
|
|
|
metadata.processOfType("web").extracting("command")
|
|
|
|
|
|
|
|
.isEqualTo(Collections.singletonList("/workspace/example.ExampleApplication"));
|
|
|
|
metadata.processOfType("native-image").extracting("command")
|
|
|
|
metadata.processOfType("native-image").extracting("command")
|
|
|
|
.isEqualTo("/workspace/example.ExampleApplication");
|
|
|
|
.isEqualTo(Collections.singletonList("/workspace/example.ExampleApplication"));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
assertImageHasDependenciesSbomLayer(imageReference, config, "native-image");
|
|
|
|
assertImageHasDependenciesSbomLayer(imageReference, config, "native-image");
|
|
|
|
}
|
|
|
|
}
|
|
|
|