cloudfoundry / cli

The official command line client for Cloud Foundry
https://docs.cloudfoundry.org/cf-cli
Apache License 2.0
1.75k stars 927 forks source link

Feature Request - Support for changing buildpack without pushing new code #1397

Open youngm opened 6 years ago

youngm commented 6 years ago

This issue is a more direct reopen of https://github.com/cloudfoundry/cli/issues/785 most all of the things I requests in https://github.com/cloudfoundry/cli/issues/785 appear to be getting addressed in the v3 set of commands except for setting the buildpack. This issue is a request to add support for changing buildpack without pushing code and without creating a manifest with the new buildpack and applying it.

Example User Story: There is a user of CF who pushes applications named Bob. Bob has a NodeJS application with 2 environments. Test and Production. Bob hasn't pushed code to production for over 2 months. In that time Bob has been working on a major refactor of the application and has been regularly deploying to his Test environment. Bob discovers that the operator of his CF deployment, Mike, has updated the nodejs buildpack with some important security fixes. Bob decides to restage his production environment to include the latest security fixes. When bob restages, he discovers that his production application fails to startup again for some unknown reason. Bob calls Mike and Mike fixes the issue and uploads the fix as a new admin buildpack for Bob to try names "nodejs_buildpack_fix_for_bob". Mike asks Bob to try that buildpack. Bob informs Mike that he cannot change the buildpack because in order to do that he must use cf push. Bob didn't tag his git repository with the code version he is currently running in production so he doesn't know what commit he is running in production making it difficult for Bob try a different buildpack.

This scenario is actually quite common in my environments. If Mike could simply tell Bob to execute something like cf restage bobs_production_app -b nodejs_buildpack_fix_for_bob it would make Mike and Bob much happier users of CF.

Perhaps unlike some environments, my environments often have several different buildpacks for each platform. Here are some examples of multiple buildpacks:

Scenarios like these are difficult to help users work through if they need to push source code to switch buildpack. Asking users to create manifests and apply a new buildpack that way isn't much easier to instruct users to do.

They CLI supports commands for setting all kinds of values on an application like health checks and such. Why not expose the ability to set the buildpack as well?

cf-gitbot commented 6 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/158330425

The labels on this github issue will be updated when the story is started.

abbyachau commented 5 years ago

cc @sclevine for visibility

abbyachau commented 5 years ago

Hi @youngm thank you for this feature request. Could you please describe the solution you would ideally like to see for this request? Thanks.

youngm commented 5 years ago

Hi @abbyachau. I'm not too picky. I think I would be happy if I could do it without using cf curl. I proposed adding it to cf restage above. But I really think I'd be happy with anything.