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

Add a cargo command for performing both packaging and a pack build #484

Open
edmorley opened this issue Jul 22, 2022 · 1 comment
Open
Labels
enhancement New feature or request libcnb-cargo

Comments

@edmorley
Copy link
Member

When developing a buildpack there are a few ways to iterate, that all have their place:

  1. Via compiler + Clippy + unit test feedback
  2. Via libcnb-test powered integration tests
  3. Via cargo libcnb package followed by pack build with the correct arguments

Currently (3) requires quite a bit of boilerplate, for example:

cargo libcnb package && pack build --builder heroku/builder:22 --pull-policy if-not-present --path tests/fixtures/empty_procfile/ --buildpack target/buildpack/debug/heroku_procfile procfile-test

In addition, this is also error prone, since it's easy to accidentally point at the wrong compiled buildpack directory (for example release instead of debug), or a leftover previous build (as happened recently with @schneems).

One way to make this workflow easier would be to have a cargo libcnb run (or similar) command, that effectively performed both the cargo libcnb package followed by the pack build with suitable --buildpack arguments. For bonus points this command could clean up the old image (or not, depending on args).

@edmorley edmorley added libcnb-cargo enhancement New feature or request labels Jul 22, 2022
@edmorley
Copy link
Member Author

edmorley commented Jul 24, 2022

As an added bonus, if we were to add a cargo libcnb run command, we could then perhaps make cargo libcnb package default to --release (given the primary use-case of that command would then be for production only), thereby fixing #359.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request libcnb-cargo
Projects
None yet
Development

No branches or pull requests

1 participant