buildpacks / pack

CLI for building apps using Cloud Native Buildpacks
https://buildpacks.io
Apache License 2.0
2.54k stars 285 forks source link

Add `--dry-run` option to pack commands #681

Open simonjjones opened 4 years ago

simonjjones commented 4 years ago

Description

I would like to validate the configuration and intended outcome of a command I plan to run without incurring the cost of executing against real code and resources

Proposed solution

Each pack command can be invoked with a --dry-run argument which:

Describe alternatives you've considered

Additional context

dfreilich commented 4 years ago

Should this be supported for all commands, or only for some? For instance, pack version --dry-run wouldn't seem to add much value, while obviously pack build --dry-run or pack rebase --dry-run would.

jromero commented 4 years ago

Could you elaborate on "outputs any pack generated logs that would occur during a real execution"?

Thinking about something like pack build how would the output be generated if it's mostly output of executed buildpacks and from my understanding the buildpack's build binary wouldn't actually execute.

yaelharel commented 4 years ago

This is a really good idea! I agree with @dfreilich (https://github.com/buildpacks/pack/issues/681#issuecomment-641576328) that it's probably not necessary for all of the pack commands. Maybe it's worth being more specific and specifying the expected output of each command (AC with examples of each relevant command).

simonjjones commented 4 years ago

I think the stateless commands should still run, the solution would still be valid as there are no interactions with external dependencies in those cases.

josegonzalez commented 3 years ago

A pack detect or similar command (with optional json output?) would be pretty neat so that we can report to users what their apps look like before actually building it (useful for platform onboarding).

aemengo commented 3 years ago

@josegonzalez Agreed. This is an underlying premise with pack-interact-mode.

aemengo commented 3 years ago

@simonjjones @jromero @dfreilich Can we have a little more detail about what the original intent of --dry-run was?

@haliliceylan and I were following the thread and are lost. In the pack build case for example:

natalieparellano commented 2 months ago

Blocked (or perhaps more accurately, superseded) by https://github.com/buildpacks/rfcs/pull/308