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

Use a default package config for a buildpackage #932

Merged
merged 2 commits into from
Nov 3, 2020

Conversation

jkutner
Copy link
Member

@jkutner jkutner commented Oct 30, 2020

Summary

This change causes pack to create a default configuration when no package.toml file is provided to the package-buildpack command. The default is the equivalent of:

[buildpack]
uri = "."

This is important for buildpack authors who want to publish to the Buildpack Registry. In order to publish, you must create a buildpackage, but learning about the package.toml file in order to share your buildpack is an unnecessary hurdle for a simple buildpack.

Output

Before

$ pack package-buildpack my-cnb
ERROR: Please provide a package config path, using --config

After

If the buildpack is a normal buildpack, it just works:

$ pack package-buildpack my-cnb
Successfully created package my-cnb

If the buildpack is a meta-buildpack it will create an error:

$ pack package-buildpack my-meta-cnb
ERROR: saving image: buildpack jkutner/minecraft@0.1.0 references buildpack heroku/jvm@0.1 which is not present

Documentation

  • Should this change be documented?
    • Yes, see #TBD
    • No

@jkutner jkutner requested a review from a team as a code owner October 30, 2020 19:58
@jkutner jkutner requested a review from elbandito October 30, 2020 19:58
Copy link
Member

@dfreilich dfreilich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like this. I think it helps the UX a lot, and it should make it more similar to pack build, which builds the application dir you are in at the moment.

plus one

Copy link
Member

@dfreilich dfreilich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UA for it fails, due to the changes from #926.
Attempting to use it results in:

$  ~/workspace/pack/out/pack package-buildpack hello-moon
ERROR: invalid platform.os specified: DOCKER_OS is linux

…is provided

Signed-off-by: Joe Kutner <jpkutner@gmail.com>
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
@jkutner jkutner force-pushed the jkutner/default-package-config branch from f228d58 to 8531ee0 Compare November 3, 2020 14:46
@jkutner jkutner requested a review from dfreilich November 3, 2020 14:57
@jkutner
Copy link
Member Author

jkutner commented Nov 3, 2020

@dfreilich fixed and rebased. thanks

@jromero jromero added this to the 0.15.0 milestone Nov 3, 2020
@jromero jromero added the type/enhancement Issue that requests a new feature or improvement. label Nov 3, 2020
@jromero jromero changed the title Create a default package config for a buildpackage Use a default package config for a buildpackage Nov 3, 2020
@jromero jromero merged commit 80ed306 into main Nov 3, 2020
@jromero jromero deleted the jkutner/default-package-config branch November 3, 2020 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Issue that requests a new feature or improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants