Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wenle opened this issue Jan 22, 2025 · 1 comment

Comments

@wenle
Copy link

wenle commented Jan 22, 2025

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?
@AidanDelaney
Copy link
Member

I think I need to have better tests for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants