cf-resource icon indicating copy to clipboard operation
cf-resource copied to clipboard

add ability to keep old version

Open flash-singh opened this issue 8 years ago • 3 comments

Not sure if this feature exists but not documented. If I use zero-downtime deployment, the process deploys the new version and deletes the old. Is it possible to add a feature which will always keep the old version and just rename it and remove the route? This allows us to rollback without much downtime in case the new app comes online and crashes later. Has this come up before?

flash-singh avatar Sep 19 '17 15:09 flash-singh

@ps0296, this sounds like a help use case. Would you be willing to provide a pull request with tests?

jtarchie avatar Sep 25 '17 17:09 jtarchie

This would be useful for us as well, but does not appear to be possible using the current blue-green mechanism. https://github.com/concourse/cf-resource/blob/0a0ad7c2396b5622f892316b27356dc79ed70e1d/out/cloud_foundry.go#L38-L45 zero-downtime-push is provided by https://github.com/contraband/autopilot, which does not support leaving the old version in a stopped (but not deleted) state.

There are also no plans for autopilot to support that use case, see contraband/autopilot#27.

cah-andrew-fitzgerald avatar Nov 21 '17 16:11 cah-andrew-fitzgerald

Hi.

I agree with @ps0296 as well. This resource use contraband/autopilot plugin which does not correspond to keeping old versions.

How about using sakkuru/rollback-push corresponding to rollback?

If we continue to use contraband/autopilot, it may be good to add a pram to out(e.g. blue-green-deployment). Feature sample is bellow.

put: resource-deploy-web-app
    params:
      manifest: build-output/manifest.yml
      blue-green-deployment: my-app-name

If blue-green-deployment param exists, cf push behavior is bellow(I referenced by sakkuru/rollback-push).

1. cf rename my-app-name my-app-name-blue
2. cf push -f build-output/manifest.yml -n my-app-name-green
3. cf map-route my-app-name-green xxxx.io (domain name) -n my-app-name
4. cf unmap-route my-app-name-blue xxxx.io (domain name) -n my-app-name
5. cf stop my-app-name-blue

What do you think of this?

cappyzawa avatar Dec 17 '17 09:12 cappyzawa