HappyTobi / cf-puppeteer

CF-Puppeteer is a zero-downtime deployment plugin bases on autopilot
https://cf-puppeteer.happytobi.com
Apache License 2.0
17 stars 4 forks source link

Custom binding activities on the new app #7

Closed ghost closed 5 years ago

ghost commented 5 years ago

Are there any suggestions on how we can do something on a new app before the routes are switched?

The reason for this is we are using NFS on PCF. NFS services must be created and bound with a configuration so they cannot just be specified in the manifest.

Our current situation is running a zero-downtime push, then stopping the app, adding the NFS service via cf service bind with a configuration and restarting it. So it is an almost no downtime push.

I think this would ideally happen in two stages. Have cf-puppeteer support a push without a remap. Do our binding and then call cf-puppeteer again to finish the route changes and cleanup. Of course the second step could be handled by us manually.

HappyTobi commented 5 years ago

Hi @ankursethi-uscis thanks for your message,

I work on a new version Release 1.0.0 which build on the new cf v3 api. With the usage of ne "newest" api we have the possibility to bring the feature you want.

I have to think about how I will bring that feature if it's the "default" or a special command to say which service should be bind lazy before we switch the route.

Kind regards

HappyTobi commented 5 years ago

Hi @ankursethi-uscis,

so i think a little bit about the feature and i will bring it in one of the next release version of puppeteer. I think i will bring 2 new arguments. --no-routes --routes-only

With the arguments it should be very easy to do everything you need between the deployments, and it should be very easy to automate these in you ci.

What do you think about?

Kind regards

ghost commented 5 years ago

This is really nice! The --routes-only will expect an app with name -venerable.

Currently we push even our background apps which don't have a route with the zero-downtime push. So maybe the --routes-only can also push with --no-start for apps without a route.

Also for apps with a route with --routes-only we would like to add --no-start. So maybe this can be added as well?

HappyTobi commented 5 years ago

Hi @ankursethi-uscis the new version is released. Please read the new blog post on the website to get some more informations.

I‘m happy to get some feedback.

ghost commented 5 years ago

@HappyTobi This is awesome. I am looking through the documentation now. I am confused about the example here: https://cf-puppeteer.happytobi.com/posts/release_1.1.0/

In the no-routes section it only mentions vendor-option but it doesn't use "no-routes". And in the section below it says:

no-routes option added - ignore route switching, should be combined with vendor-option

I am not clear what vendor-option does and why it is necessary. But this work is great!

HappyTobi commented 5 years ago

Thx for the feedback i think if have to document the option a bit more. The vendor-option is for stop, delete or do nothing with the renamed Application. (The old one AppName-ven )

I will update the blog and the documentation

ghost commented 5 years ago

Oh the confusion is for venerable. Venerable means respectable or old. Vendor means supplier.

venerable is long but you can't use vendor.

venerable-action will be the best and clear

ghost commented 5 years ago

Also will venerable-action be necessary for --no-routes? Maybe a default of none for venerable-action can be applied when using --no-routes. That way only --no-routes is necessary for the common use case.

HappyTobi commented 5 years ago

Thx for the Import, i think i will change it like that in the next version 1.2.0

Right now the default ist delete, and you don‘t have to use that it also work without the action command

HappyTobi commented 5 years ago

Hi @ankursethi-uscis i released a new version where i changed the argument name and the route venerable combination. See the latest blog post

ghost commented 5 years ago

@HappyTobi Thanks this is great!