boson-project / buildpacks

Boson Project function buildpacks
Apache License 2.0
5 stars 11 forks source link

fix: improve caching for invoker and main path discovery #98

Closed lance closed 3 years ago

lance commented 3 years ago

Previously the build phase would only install the invoker once. After this, if /workspace/.invoker directory was found, it would just assume the invoker was already there and skip it.

A case where this could be a problem is if the invoker has been updated in the buildpack. Functions that have previously been built will skip installation of the new invoker.

This change modifies the behavior so that the invoker itself is always installed. This is no problem with build time. It just copies two files. Then the package-lock.json checksum is used to determine if there has been a change, and if so, run npm ci again.

Signed-off-by: Lance Ball lball@redhat.com