GithubHelp home page GithubHelp logo

jsloyer / cf-blue-green Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cloud-gov/cf-blue-green

0.0 2.0 0.0 18 KB

zero-downtime deployment for Cloud Foundry applications

License: Other

Shell 100.00%

cf-blue-green's Introduction

Note: if your application's manifest is "complete", use Autopilot instead. More info below, in the Autopilot README, and in this Issue.

Cloud Foundry blue-green deployment

Allows zero-downtime deployments of applications within Cloud Foundry, with no additional setup needed.

Usage

  1. Install the cf CLI v6.12.4+.
  2. Run npm install -g cf-blue-green.
    • See Notes below for non-Node installation.
  3. Run cf-blue-green <appname> (instead of cf-push) from your application directory to deploy.

This creates a copy of your already-running application, and safely switches traffic over to it. It's recommended that you try this script on a non-production application environment first, just to ensure that everything is switched over properly.

Notes

Manual installation

The script is distributed via NPM, but doesn't actually require Node.js beyond that. If you don't want to install Node, simply:

  1. Download the script.
  2. Run chmod a+x cf-blue-green.
  3. Move the file somewhere in your PATH.

Using with Travis

Travis supports continuous deployment, which will automatically deploy your application after its tests pass on a specified branch. To use cf-blue-green with Travis, you need to use a script provider instead of the default Cloud Foundry provider. Your Cloud Foundry settings are read from environment variables.

Set up continuous deployment with the following settings in your .travis.yml file:

sudo: true
env:
  global:
  - CF_APP=[app name]
  - CF_API=[API endpoint]
  - CF_USERNAME=[user]
  - CF_ORGANIZATION=[organization]
  - CF_SPACE=[space]
  - secure: [CF_PASSWORD=[encrypted with Travis](http://docs.travis-ci.com/user/environment-variables/#Encrypted-Variables)]
before_deploy: npm install -g cf-blue-green
deploy:
  provider: script
  script: cf-blue-green-travis
  on:
    branch: [git branch you want to deploy]

Manifests

cf-blue-green creates a temporary manifest from your live application, meaning that it ignores the manifest.yml in your directory, if you have one. To deploy any changes to your manifest, use cf push directly.

Resources

More information about blue-green deployment, all of which this script drew from.

cf-blue-green's People

Contributors

afeld avatar dhcole avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.