Merge branch '2.4.x'

Closes gh-25840
This commit is contained in:
Scott Frederick
2021-05-12 15:48:59 -05:00
40 changed files with 364 additions and 229 deletions

View File

@@ -0,0 +1,10 @@
= Spring Boot Test Builder
This directory contains a Cloud Native Buildpacks https://buildpacks.io/docs/concepts/components/builder/[builder] and https://buildpacks.io/docs/concepts/components/buildpack/[buildpack] that is used by integration tests to verify the behavior of the Spring Boot build plugins.
== Creating the builder
* Install the https://buildpacks.io/docs/install-pack/[pack CLI]
* Authenticate to projects.registry.vmware.com via `docker login`
* Use the `build.sh` create the necessary images and push them to the registry

View File

@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -x -eo pipefail
docker pull paketobuildpacks/build:tiny-cnb
docker tag paketobuildpacks/build:tiny-cnb projects.registry.vmware.com/springboot/build:tiny-cnb
docker push projects.registry.vmware.com/springboot/build:tiny-cnb
docker pull paketobuildpacks/run:tiny-cnb
docker tag paketobuildpacks/run:tiny-cnb projects.registry.vmware.com/springboot/run:tiny-cnb
docker push projects.registry.vmware.com/springboot/run:tiny-cnb
cd builder
pack builder create projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1 --config builder.toml
docker push projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1
cd -

View File

@@ -0,0 +1,17 @@
# Buildpacks to include in builder
[[buildpacks]]
id = "spring-boot/test-info"
version = "0.0.1"
uri = "../buildpacks/test-info"
# Order used for detection
[[order]]
[[order.group]]
id = "spring-boot/test-info"
version = "0.0.1"
# Stack that will be used by the builder
[stack]
id = "io.paketo.stacks.tiny"
build-image = "projects.registry.vmware.com/springboot/build:tiny-cnb"
run-image = "projects.registry.vmware.com/springboot/run:tiny-cnb"

View File

@@ -0,0 +1,35 @@
#!/usr/bin/env bash
set -eo pipefail
echo "---> Test Info buildpack building"
# INPUT ARGUMENTS
platform_dir=$2
env_dir=${platform_dir}/env
bindings_dir=${platform_dir}/bindings
if [[ -f ${env_dir}/FORCE_FAILURE ]]; then
echo "Forced builder failure"
exit 1
fi
if compgen -G "${env_dir}/*" > /dev/null; then
for var in ${env_dir}/*; do
echo "env: $(basename ${var})=$(<${var})"
done
fi
if compgen -G "${bindings_dir}/*" > /dev/null; then
for binding in ${bindings_dir}/*; do
for f in ${binding}/*; do
echo "binding: $(basename ${binding})/$(basename ${f})=$(<${f})"
done
done
fi
echo "META-INF/MANIFEST.MF: "
if [[ -f META-INF/MANIFEST.MF ]]; then
cat META-INF/MANIFEST.MF
fi
echo "---> Test Info buildpack done"

View File

@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -eo pipefail
# 1. CHECK IF APPLICABLE
if [[ ! -f META-INF/MANIFEST.MF ]]; then
exit 100
fi
# 2. GET ARGS
plan_path=$2
# 3. DECLARE DEPENDENCIES (OPTIONAL)
cat >> "${plan_path}" <<EOL
# Buildpack provides this dependency
#
# NOTE: The dependency is provided during the 'build' process.
#
[[provides]]
name = "test-info"
# Buildpack requires this dependency
#
# NOTE: Everything aside from 'name' is simply additional information that the providing buildpack can use to resolve
# the dependency.
#
[[requires]]
name = "test-info"
EOL

View File

@@ -0,0 +1,13 @@
# Buildpack API version
api = "0.2"
# Buildpack ID and metadata
[buildpack]
id = "spring-boot/test-info"
version = "0.0.1"
name = "Spring Boot Test Info Buildpack"
homepage = "https://github.com/spring-projects/spring-boot"
# Stacks that the buildpack will work with
[[stacks]]
id = "io.paketo.stacks.tiny"