Giter Club home page Giter Club logo

autocanary24's Introduction

AutoCanary24

Build Status

AutoCanary24 is a ruby utility to do blue/green and canary deployments with AWS CloudFormation stacks.

This library use the Swap AutoScaling Groups approach and expects two stacks. A "base" stack which includes at least the ELB and another which includes the AutoScaling Group.

Installation

Add this line to your application's Gemfile:

gem 'autocanary24'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install autocanary24

Usage

Prerequisite: Deploy the base stack before

Initialize the client, e.g. in your Rakefile and deploy your stack:

# Configure the AutoCanary24 Client
ac = AutoCanary24::Client.new({
  keep_inactive_stack: false,
  keep_instances_balanced: false,
  scaling_instance_percent: 50
})

The available configuration:

  • keep_inactive_stack: If true the inactive stack gets not deleted. Default is false
  • keep_instances_balanced: If true a instance from current stack gets removed whenever a new instance from the new stack is added. If false first all new instances are created and afterwards the old instances gets removed. Default is false
  • scaling_instance_percent: Percent of instances which are added at once (depends on the actual number of instances, read from desired). Default is 100
  • wait_timeout: Timeout in seconds to wait for checking AWS operations are done before do a rollback. Default is 300
# Execute the deployment
ac.deploy_stack(parent_stack_name, template, parameters, tags, deployment_check)

The available parameters:

  • parent_stack_name: the name of the 'base' stack. In addition AutoStacker24 will read the output parameters of an existing stack and merge them to the given parameters.
  • template: is either the template json data itself or the name of a file containing the template body
  • parameters: specify the input parameter as a simple ruby hash. It gets converted to the cumbersome AWS format automatically. The template body will be validated and optionally preprocessed.
  • tags: Optional. Key-value pairs to associate with this stack.
  • deployment_check: Optional. A lambda which is executed whenever new instances are added to the ELB. If true AutoCanary continues, if false it will rollback to the current stack.

For more information about stacked CloudFormation stacks visit AutoStacker24.

Examples

Have a look into the examples subfolder

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/autoscout24/autocanary24.

License

The gem is available as open source under the terms of the MIT License.

autocanary24's People

Watchers

 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.