docs icon indicating copy to clipboard operation
docs copied to clipboard

Script in document <Orchestrate a build with the CNB lifecycle> does not work

Open wenle opened this issue 11 months ago • 1 comments

Summary

I followed the steps in https://buildpacks.io/docs/for-platform-operators/tutorials/lifecycle/ when go to the "detect" phase (https://buildpacks.io/docs/for-platform-operators/tutorials/lifecycle/#detect) there is a script to copy buildpacks to tutorial directory to demo detect

for f in $(ls --color=no ${CNB_SAMPLES_PATH}/buildpacks | grep -v README)
do
bp_version=$(cat ${CNB_SAMPLES_PATH}/buildpacks/$f/buildpack.toml | dasel -r toml buildpack.version | sed s/\'//g);
mkdir -p ./buildpacks/samples_"${f}"/${bp_version}
cp -r "$CNB_SAMPLES_PATH/buildpacks/${f}/" ./buildpacks/samples_"${f}"/${bp_version}/
done

detect will get error: ERROR: failed to initialize detector: open /tmp/tutorial/buildpacks/samples_java-maven/0.0.2/buildpack.toml: no such file or directory

I do a little change to the script to fix it, it works.

cp -r $CNB_SAMPLES_PATH/buildpacks/${f}/* ./buildpacks/samples_"${f}"/${bp_version}/

I looks like lifecycle has changed and expects a different directory structure.


Reproduction

Steps

Just do according to the document

Current behavior

detect will get error: ERROR: failed to initialize detector: open /tmp/tutorial/buildpacks/samples_java-maven/0.0.2/buildpack.toml: no such file or directory

Expected behavior

detect success


Context

lifecycle version
platform version(s)
anything else?

wenle avatar Jan 22 '25 02:01 wenle

I think I need to have better tests for this

AidanDelaney avatar Jan 23 '25 08:01 AidanDelaney