Commit Graph

223 Commits (e8c3157db577520029c16d18c0572d49a1671e3b)

Author SHA1 Message Date
Moritz Halbritter 94d095ce1a Merge branch '2.6.x' into 2.7.x
Closes gh-29692
3 years ago
Moritz Halbritter 079ea41d6d Merge branch '2.5.x' into 2.6.x
Closes gh-29691
3 years ago
Moritz Halbritter 262db65a38 Ignore invalid stream types when reading log update events
See gh-29675
3 years ago
Phillip Webb ce08b519b1 Merge branch '2.6.x' into 2.7.x 3 years ago
Phillip Webb 50e0e28155 Merge branch '2.5.x' into 2.6.x 3 years ago
Phillip Webb 2b40ce09d8 Update copyright year of changed files 3 years ago
Stephane Nicoll f812b33cbd Merge branch '2.6.x' into 2.7.x
Closes gh-29613
3 years ago
Stephane Nicoll 136b5959c3 Merge branch '2.5.x' into 2.6.x
Closes gh-29612
3 years ago
Stephane Nicoll 7f17f819a6 Polish "Enforce use of BDDMockito"
See gh-29178
3 years ago
Yanming Zhou b49418aaaf Enforce use of BDDMockito
1. Replace Mockito.verify*() with BDDMockito.then()
2. Replace Mockito.doReturn() with BDDMockito.willReturn()
3. Adjust checkstyle rule

See gh-29178
3 years ago
Scott Frederick 698eb94913 Merge branch '2.6.x' into 2.7.x
Closes gh-29554
3 years ago
Scott Frederick 909ef6d635 Merge branch '2.5.x' into 2.6.x
Closes gh-29553
3 years ago
Scott Frederick 000cbfa2d9 Set file permissions on all created test files
Closes gh-29551
3 years ago
Scott Frederick 3cb30cb283 Merge branch '2.6.x' into 2.7.x
Closes gh-28923
3 years ago
Scott Frederick 3555837845 Merge branch '2.5.x' into 2.6.x
Closes gh-28922
3 years ago
Scott Frederick b0b2cd79b4 Use latest buildpack image tag when no tag is provided
Fixes gh-28921
3 years ago
Scott Frederick 5f14cffea3 Add support for CNB platform API 0.5 through 0.8
Fixes gh-28850
3 years ago
Andy Wilkinson 2a342ef416 Merge branch '2.5.x'
Closes gh-28662
3 years ago
Andy Wilkinson 5e4a502b2d Merge branch '2.4.x' into 2.5.x
Closes gh-28661
3 years ago
Andy Wilkinson 2cec3971d7 Prohibit unwanted dependencies in all modules not just starters
Closes gh-28658
3 years ago
Stephane Nicoll 9241f228d5 Add .gitattributes
Closes gh-28474
3 years ago
Stephane Nicoll 66553ac8c7 Add .gitattributes
Closes gh-28473
3 years ago
Stephane Nicoll 1b3f52d609 Harmonize line endings
See gh-27615
3 years ago
Scott Frederick 871468931f Polish "Add option to customize cache volume names when building an image"
See gh-28292
3 years ago
Julian Liebig dc36346285 Add option to customize cache volume names when building an image
This commit adds configuration to the Maven and Gradle plugins to
allow specifying the names of build and launch cache volumes provided
to the CNB builder.

See gh-28292
3 years ago
Andy Wilkinson 48b1175559 Merge branch '2.5.x'
Closes gh-28263
3 years ago
Andy Wilkinson d47260637b Merge branch '2.4.x' into 2.5.x
Closes gh-28262
3 years ago
Andy Wilkinson c5d45585d9 Remove unnecessary overrides of finalize
Closes gh-28209
3 years ago
Scott Frederick 64c49003aa Polish "Add option to create tags for a built image"
See gh-27613
3 years ago
Rafael Ceccone 66f44b0c7f Add option to create tags for a built image
This commit adds configuration to the Maven and Gradle plugins to
allow specifying multiple tag to be created that refer to the built
image.

See gh-27613
3 years ago
dreis2211 cf0fcafd13 Polish
See gh-27940
3 years ago
Scott Frederick a6d03279ca Merge branch '2.5.x'
Closes gh-27994
3 years ago
Scott Frederick a540da11ad Merge branch '2.4.x' into 2.5.x
Closes gh-27993
3 years ago
Scott Frederick c8ff874e91 Add builderFor label to ephemeral builder image
Adding a label to the ephemeral builder image cloned from the base
builder image eliminates contention between builds that are run
concurrently. Without this label, concurrent builds could result in
a race condition in the Docker daemon if the ephemeral builder image
shared by builds was deleted by both builds at exactly the same time.

Fixes gh-27888
3 years ago
Andy Wilkinson fd2fbcb3c6 Merge branch '2.5.x'
Closes gh-27758
3 years ago
Andy Wilkinson 6d8ba3e8b1 Merge branch '2.4.x' into 2.5.x
Closes gh-27757
3 years ago
Andy Wilkinson ffbd28b60a Polish "Polish access modifiers for test classes"
See gh-27736
3 years ago
izeye 8a425dedfd Polish access modifiers for test classes
See gh-27736
3 years ago
Scott Frederick 2178c281e9 Polish "Add network option for image building"
See gh-27486
3 years ago
Jeroen Meijer 8e6d03b221 Add network option for image building
This commit adds configuration to the Maven and Gradle plugins to
allow specifying the network mode to be provided to the image
building goal and task.

See gh-27486
3 years ago
Scott Frederick 9f001efa29 Adjust fat jar central directory to account for launch script
An upgrade to Apache Commons Compress allows the build plugins to write
the launch script to the fat jar as a proper preamble, making the file
compatible with more jar and zip tooling.

Fixes gh-22336
3 years ago
Stephane Nicoll dc5acb0019 Remove deprecated code flagged for removal
Closes gh-27303
3 years ago
Scott Frederick fba5ffc626 Fix FilePermissionsTests on Windows
See gh-26658
3 years ago
Scott Frederick f560e86f03 Write buildpack directories to builder layer
When a custom buildpack is provided for image building, the contents
of the buildpack directory, tgz file, or image are copied as tar
entries to a new layer in the ephemeral builder image. Prior to this
commit, only file entries from the buildpack source were copied as
builder layer tar entries; intermediate directory entries from the
source were not copied. This results in directories being created in
the builder container using default permissions. This worked on most
Linux-like OSs where the default permissions allow others-read
access. On some OSs like Arch Linux where the default directory
permissions do not allow others-read, this prevented the lifecycle
processes from reading the buildpack files.

This commit explicitly creates all intermediate directory tar entries
in the builder image layer to ensure that the buildpack directories
and files can be read by the lifecycle processes.

Fixes gh-26658
4 years ago
Phillip Webb d3f0f04f05 Merge branch '2.4.x'
Closes gh-26703
4 years ago
Phillip Webb 49d3ecc2b2 Merge branch '2.3.x' into 2.4.x
Closes gh-26702
4 years ago
Phillip Webb 617f7b9587 Improve ImageName/ImageReference parse performance
Update `ImageName` and `ImageReference` to use distinct regex patterns
to parse specific parts of the value. Prior to this commit a single
regex pattern was used which could hang given certain input strings.

Fixes gh-23115
4 years ago
weixsun 8a2be288a3 Remove unnecessary throws declaration in tests
See gh-26441
4 years ago
Scott Frederick e9adb1ab88 Handle long file names in buildpack images
Fixes gh-26445
4 years ago
Scott Frederick 86303c017b Merge branch '2.4.x'
Closes gh-25938
4 years ago
Scott Frederick 9108b81bb2 Merge branch '2.3.x' into 2.4.x
Closes gh-25937
4 years ago
Scott Frederick 0ad7f76263 Preserve file permissions in images built by Gradle
This commit copies the file mode along with other attributes when
copying files from the source archive to the build container while
building an image using the Gradle plugin. This preserves file
permissions on any resources included in the source archive.

Fixes gh-25915
4 years ago
Phillip Webb 8c31d29acf Merge branch '2.4.x' 4 years ago
Phillip Webb a28a3ae090 Merge branch '2.3.x' into 2.4.x 4 years ago
Phillip Webb 44b1751bb4 Merge branch '2.4.x'
Closes gh-25826
4 years ago
Phillip Webb 363f5829d1 Merge branch '2.3.x' into 2.4.x
Closes gh-25825
4 years ago
Phillip Webb 685b045c3d Polish 4 years ago
Scott Frederick 76e42ff96f Correct grouping of custom buildpacks
This commit corrects the order.toml file that is generated and added
to the builder when building an image using custom buildpacks with the
Maven or Gradle plugin in order to support buildpacks that depend on
detection as a group.

Fixes gh-25378
4 years ago
Scott Frederick 89555a8745 Add bindings option for image building
This commit adds configuration to the Maven and Gradle plugins to
allow a list of volume mount bindings to be provided to the image
building goal and task. This enables service bindings to be mounted
in the builder image that are recognized by buildpacks to support
custom certificates, build tool configuration, APM integration, and
other buildpack features.

Fixes gh-23518
4 years ago
Phillip Webb 4ad149e1e7 Protect against bad paths and URLs
See gh-21722
4 years ago
Scott Frederick e3e229cc3d Remove unused import
See gh-21722
4 years ago
Scott Frederick f54f784f80 Add buildpack option for image building
This commit adds configuration to the Maven and Gradle plugins to
allow a list of buildpacks to be provided to the image building
goal and task.

Fixes gh-21722
4 years ago
Andy Wilkinson db781a0d84 Merge branch '2.4.x'
See gh-25077
4 years ago
Andy Wilkinson 788a42d694 Merge branch '2.3.x' into 2.4.x
See gh-25076
4 years ago
Andy Wilkinson 67479b6380 Add junit-platform-launcher dependency by convention
Closes gh-25074
4 years ago
Phillip Webb d8b6960997 Merge branch '2.4.x'
Closes gh-25077
4 years ago
Phillip Webb 257608a3a3 Merge branch '2.3.x' into 2.4.x
Closes gh-25076
4 years ago
Phillip Webb 939b5dfc26 Add junit-platform-launcher dependency
Update `build.gradle` files to ensure that `junit-platform-launcher` is
a `testRuntimeOnly` dependency. This ensures that tests can be run from
Eclipse.

Closes gh-25074
4 years ago
Scott Frederick 9925c4ccd2 Merge branch '2.4.x'
Closes gh-24794
4 years ago
Scott Frederick a9e711e503 Enforce builder and run images in the same registry
Previously, when an authenticated Docker builder registry was
configured in the Maven or Gradle plugin and the builder and run
images specified different registries, the authentication credentials
would be sent to both registries. This could cause confusion if both
registries don't recognize the same credentials. This commit enforces
that both images are in the same registry when authentication
is configured.

Fixes gh-24552
4 years ago
Stephane Nicoll a6c6655c82 Polish "Upgrade to Jackson 2.12.0"
Guard breaking change to PropertyNamingStrategies so that we tolerate
older Jackson versions.

See gh-24415
4 years ago
Valery Yatsynovich 1f63b82c5b Upgrade to Jackson 2.12.0
See gh-24415
4 years ago
Scott Frederick 04a40a4c68 Provide content-length header to Docker API calls
Docker daemon authorization plugins reject POST or PUT requests that have a
content type `application/json` header but no content length header. This
commit ensures that a content length header is provided in these cases.

This is a cherry-pick of the changes in d5b2836ec9
which were lost in a forward-merge.

Fixes gh-23957
4 years ago
Scott Frederick d5b2836ec9 Provide content-length header to Docker API calls
Docker daemon authorization plugins reject POST or PUT requests that have a
content type `application/json` header but no content length header. This
commit ensures that a content length header is provided in these cases.

Fixes gh-22840
4 years ago
Andy Wilkinson 2d8528d5bd Adapt to deprecation of StringUtils.isEmpty(Object)
See gh-23774
4 years ago
Scott Frederick 38984985d4 Add support for CNB platform API 0.4
This commit adds support for platform API 0.4 when invoking a CNB
builder in the Maven and Gradle plugins. If the builder advertises
that it supports platform API 0.4 then that version will be
requested when invoking lifecycle phases. Otherwise the plugins
will fall back to requesting platform API 0.3.

Requesting platform API 0.4 when invoking builder lifecycle phases
has the primary benefit of making it easier to pass command-line
arguments to the default process in the generated image.

Fixes gh-23692
4 years ago
Scott Frederick 5b1b03c56c Set platform API version when invoking image builder
The CNB specifications allow builders to support multiple platform
API versions. The supported versions are published in the builder
image metadata as an array of version numbers, while a single
supported version number was published in earlier builder metadata.

These changes read the supported versions from the builder metadata
and fall back to the single version if the array is not present.
A CNB_PLATFORM_API environment variable is set on each lifecycle
phase invocation to request a specific version as recommended in
the CNB platform spec.

Fixes gh-23682
4 years ago
Scott Frederick 0e7ab88491 Polish "Update default builder image"
See gh-23628
4 years ago
Emily Casey 461dc23c0c Update default builder image
This commit updates the default builder image used by the Maven
and Gradle plugins image-building goal and task to use the latest
Paketo builder image. The builder image is pulled from Docker Hub
instead of Google Container Registry by default.

See gh-23628
4 years ago
Scott Frederick 09b627d232 Add support for publishing docker images to a registry
This commit adds options to the Maven and Gradle plugins to publish
to a Docker registry the image generated by the image-building goal
and task.

The Docker registry auth configuration added in an earlier commit
was modified to accept separate auth configs for the builder/run
image and the generated image, since it is likely these images will
be stored in separate registries or repositories with distinct
auth required for each.

Fixes gh-21001
4 years ago
Scott Frederick 54288678d1 Configure Docker host in build plugins
This commit adds the ability to configure the Maven and Gradle
plugins to use a remote Docker daemon using build file
configuration, as an alternative to setting environment variables
to specify remote host connection details.

Fixes gh-23400
4 years ago
Phillip Webb 27095d9043 Polish 4 years ago
Scott Frederick 86fa8144f5 Polish "Support authentication to private Docker registry"
See gh-22972
4 years ago
姜为 e8f555e13d Support authentication to private docker registry
This commit adds the ability to configure Docker image registry
authentication credentials in the Maven and Gradle plugins. The
authentication credentials are passed to the Docker daemon with
all daemon API calls, and the daemon forwards the credentials to the
image registry when necessary. This makes it possible to use
builder and run images stored in a private Docker registry.

See gh-22972
4 years ago
Scott Frederick b70d0dd5ac Merge branch '2.3.x'
Closes gh-23134
4 years ago
Scott Frederick bc1834bfdf Ensure layer digest hashes contain 64 characters
This commit ensures that encoded digest hashes for Docker image
layers are zero-padded to the required 64 characters length.

Fixes gh-23132
4 years ago
Scott Frederick ccabc1a4c9 Merge branch '2.3.x'
Closes gh-23133
4 years ago
Scott Frederick 4f1b4c98ae Fail on Docker image load with empty response
In some cases, a call to the Docker image load API will fail but
return a 200 OK response status code and an empty response. This
commit detects that the response from this call is empty and
treats this condition as an error instead of a silent failure.

Fixes gh-23130
4 years ago
dreis2211 33cd875cb8 Simplify InputStream assertions
See gh-23052
4 years ago
Scott Frederick ee41d71ea8 Merge branch '2.3.x'
Closes gh-23016
4 years ago
Scott Frederick 56bc0eb9e0 Use canonical path for CNB builder lifecycle binaries
This commit changes the path used to invoke lifecycle binaries in
CNB builders from `/lifecycle` to `/cnb/lifecycle` to conform to
the CNB spec. This will ensure the build plugin image-building
goals and tasks are compatible with future versions of builders
that may not support both paths.

See gh-23009
4 years ago
Scott Frederick 6b15822cb1 Polish "Add pullPolicy option for image building"
See gh-22736
4 years ago
anshlykov c7449b57ce Add pullPolicy option for image building
This commit adds a pullPolicy option to the configuration of the Maven
plugin spring-boot:build-image goal and the Gradle plugin bootBuildImage
task. The new option gives users control over pulling the builder image
and run image from a remote image registry to the local Docker daemon.

See gh-22736
4 years ago
Andy Wilkinson 969dd35e45 Upgrade to Mockito 3.4.6
Closes gh-22838
4 years ago
Scott Frederick f247fec310 Merge branch '2.3.x'
Closes gh-22735
4 years ago
Scott Frederick 21b2dd2740 Allow empty env entries when building an image
Prior to this commit, an entry in the environment map provided to the
build plugin image building goal or task that had a null value would
result in a failure with a message that was difficult to diagnose.

This commit treats env map entries with a null value as an empty
entry to prevent the failure and also make it easier to provide an
explicit empty entry in the Maven XML.

Fixes gh-22703
4 years ago
dreis2211 e49e2dfff1 Use Supplier variants of Assert methods
See gh-22699
4 years ago
Phillip Webb da69286838 Merge branch '2.3.x' 4 years ago
Phillip Webb d2a7808098 Polish 4 years ago
Scott Frederick e6318f83b2 Merge branch '2.3.x'
Closes gh-22349
4 years ago