-
Notifications
You must be signed in to change notification settings - Fork 294
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
Add buildpack create command to generate new buildpack scaffolding #1025
Conversation
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
@jkutner I assume this is scaffolding for a Bash buildpack? I worry somewhat that he existence of this command will encourage folks to write complex buildpacks in Bash, which may not be a pleasant experience in the long run. |
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
@ekcasey no, there's a Sidenote: I disagree about bash "not be a pleasant experience in the long run". Many buildpacks v2 are written in bash and have been successful and well maintained for years. |
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
bb5df64
to
f638c0e
Compare
Codecov Report
@@ Coverage Diff @@
## main #1025 +/- ##
==========================================
- Coverage 80.56% 80.39% -0.17%
==========================================
Files 131 133 +2
Lines 8050 8156 +106
==========================================
+ Hits 6485 6556 +71
- Misses 1147 1171 +24
- Partials 418 429 +11
Flags with carried forward coverage won't be shown. Click here to find out more. |
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
return createBashBuildpack(opts.Path, c) | ||
} | ||
|
||
func createBashBuildpack(path string, c *Client) error { |
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.
nit: if we don't need the rest of the client, does it make more sense to just pass the logger
?
Signed-off-by: Joe Kutner <jpkutner@gmail.com> Co-authored-by: David Freilich <dfreilich@vmware.com>
Signed-off-by: Joe Kutner <jpkutner@gmail.com> Co-authored-by: David Freilich <dfreilich@vmware.com>
Signed-off-by: Joe Kutner <jpkutner@gmail.com> Co-authored-by: David Freilich <dfreilich@vmware.com>
…s exist Signed-off-by: Joe Kutner <jpkutner@gmail.com>
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
internal/commands/buildpack_new.go
Outdated
} | ||
|
||
path := filepath.Join(flags.Path, dirName) | ||
if len(path) == 0 { |
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.
Should this be flag.Path
? Otherwise, assuming they're passing in a string, I don't see how this if block can be reached.
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.
Fixed in 9e20ac0
Signed-off-by: Joe Kutner <jpkutner@gmail.com> Co-authored-by: David Freilich <dfreilich@vmware.com>
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
@jkutner found a few oddities when trying to use this command. Would you mind addressing them?
|
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
@jromero fixed all three issues |
@jkutner, verified issues above were resolved. Left a single nitpick but feel free to merge. |
Signed-off-by: Joe Kutner <jpkutner@gmail.com>
Summary
Generates the basic files needed for a buildpack written in Bash:
buildpack.toml
bin/build
bin/detect
Output
Before
N/A
After
Documentation
Related
Resolves #82 (finally! 😄 )
buildpacks/rfcs#136