-
Notifications
You must be signed in to change notification settings - Fork 12
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
Conditionally packaging a buildpack or an extension #934
Conditionally packaging a buildpack or an extension #934
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - thanks.
I cleaned up some code a bit, and left a comment inline for a potential future refactor.
implementation/scripts/package.sh
Outdated
buildpack package "${output}" \ | ||
--path "${BUILD_DIR}/buildpack.tgz" \ | ||
--format file | ||
pushd "${BUILD_DIR}/cnbdir" > /dev/null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially i was confused why we were not doing something similar to the pack buildpack package --path <path>
below, then I realized that pack extension package
doesn't have that feature.
I opened this feature request on pack -if/when that lands we can clean this up.
@ForestEckhardt wondering if you might have time to help review/land? |
implementation/scripts/package.sh
Outdated
buildpack::archive "${version}" | ||
buildpackage::create "${output}" | ||
buildpack_type=buildpack | ||
if [ -f "extension.toml" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be an absolute path as well to solve the same problem as seen in #947?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ForestEckhardt There was no error on that one, but I changed it anyway to point to an absolute path. I also rebased the branch.
5141169
to
073f2a3
Compare
073f2a3
to
8319f9b
Compare
8319f9b
to
c418eb5
Compare
Summary
This PR changes the package.sh script to conditionally package a buildpack or an extension according to whether is an extension or a buildpack.
The way this is implemented is to check whether the extension file exists on the directory, otherwise, it fallbacks to the default behavior of packaging a buildpack.
Test results:
Use Cases
Checklist