Sha256: 5dbc1dbce357c5a95edfda893d87e9802853844880e501666635868f36aae22e

Contents?: true

Size: 1.64 KB

Versions: 2

Compression:

Stored size: 1.64 KB

Contents

hadouken - soon

### running

    ./serviceie.rb --interactive \ 
                 --level debug \
                 --environment production \
                 --history /opt/deploys   \
                 --artifact https://artifacts/latest.tgz


### serviceie.rb

    Hadouken::Runner.run!
      plan      = Hadouken::Plan.new
      plan.name = "serviceie"
      plan.user = "serviceie"
      plan.base = "/opt/serviceie"
   
      # define some groups 10x10
      #
      plan.add_group :web, :range => (1..10), :pattern => 'serviceie-web-%02d.example.com'
      plan.add_group :api, :range => (1..10), :pattern => 'serviceie-api-%02d.example.com'


      # download latest.tgz from our artifact repository
      # runs in parallel on all hosts
      #
      plan.tasks.add Hadouken::Strategy::ByHost.new(plan)
      plan.tasks.add "curl -sSfL -output /tmp/latest.tgz #{artifact}"
      plan.tasks.add "mv /tmp/latest.tgz #{plan.base}/latest.tgz"


      # runs commands depth first on the api hosts, two at a time
      # - restart service
      # - verify  service
      #
      plan.tasks.add Hadouken::Strategy::ByHost.new(plan, :max_hosts => 2, :traversal => :depth)
      plan.tasks.add "restart serviceie-api", :group => :api
      plan.tasks.add Proc.new { |opts|
        host = opts[:host]
        10.times do
          response = Typheous::Request.get("http://#{host}:8081/healthcheck")
          break if response.status_code == 200
        end
      }, :group => :api

      
      # finally restart the webs as fast as possible
      #
      plan.tasks.add Hadouken::Strategy::ByHost.new(plan)
      plan.tasks.add "restart windard-web, :group => :web
    end


Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hadouken-0.1.5.pre README.md
hadouken-0.1.4.pre README.md