Skip to content

Instantly share code, notes, and snippets.

@derekcollison
Created April 16, 2011 17:11
Show Gist options
  • Save derekcollison/923303 to your computer and use it in GitHub Desktop.
Save derekcollison/923303 to your computer and use it in GitHub Desktop.

Revisions

  1. derekcollison created this gist Apr 16, 2011.
    36 changes: 36 additions & 0 deletions Cloud Foundry Production Updates
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@

    # vmc update is great for test and development, however it stops your old app and stages and starts the new one,
    # resulting in dropped requests.
    # If you want to update an application without dropping user requests, see below.
    # NOTE: This change assumes your application can share services, etc with the new version.

    # Assume my app is named foo

    vmc push foo-v2 --url foov2.cloudfoundry.com

    # New app is running under a different url that can be tested independently.

    vmc map foo-v2 foo.cloudfoundry.com

    # New app and old app are now fielding traffic to http://foo.cloudfoundry.com

    vmc instances foo-v2 N

    # Scale up if needed.

    vmc instances foo 1

    # Scale old app down

    vmc unmap foo foo.cloudfoundry.com

    # New app is fielding all traffic at this point

    # if you need to rollback.
    vmc map foo foo.cloudfoundry.com
    vmc unmap foo-v2 foo.cloudfoundry.com

    # Now you can stop or delete the old version
    vmc stop foo

    # I leave these around, in a stopped state with no urls, but bound to any services needed. This way I can put new bits into this app's namespace with vmc update foo